Skip to content

anbeime/skill / skills/paper-analysis-assistant/paper-analysis-assistant

paper-analysis-assistant

Verified

其他高等院校教师与数据科学家在追踪前沿学术时,当需要深度解析arXiv论文,用此技能可一键下载PDF并自动生成词频分析、双人播客、交互式网页、PPT演示与总结图,将数小时的文献阅读转化为多媒体内容,效率提升十倍!

scripts/text_to_speech.py

View on GitHub
#!/usr/bin/env python3
"""
文本转语音(使用 pyttsx3)
"""
import argparse
import os
import pyttsx3


def text_to_speech(txt_path: str, output_path: str, voice_rate: int = 150) -> None:
    """
    将文本转换为语音文件

    Args:
        txt_path: 文本文件路径
        output_path: 输出 wav 文件路径
        voice_rate: 语音速率(默认 150)
    """
    print(f"正在进行文本转语音: {txt_path}")

    # 读取文本
    with open(txt_path, 'r', encoding='utf-8') as f:
        text = f.read()

    # 限制文本长度,避免生成过大的语音文件
    max_length = 50000  # 限制为前 50000 个字符
    if len(text) > max_length:
        text = text[:max_length]
        print(f"警告: 文本过长,仅使用前 {max_length} 个字符")

    # 初始化语音引擎
    engine = pyttsx3.init()

    # 设置语音速率
    engine.setProperty('rate', voice_rate)

    # 确保输出目录存在
    output_dir = os.path.dirname(output_path)
    if output_dir:
        os.makedirs(output_dir, exist_ok=True)

    # 保存为语音文件
    try:
        engine.save_to_file(text, output_path)
        engine.runAndWait()
        print(f"语音文件已保存到: {output_path}")
    except Exception as e:
        raise Exception(f"语音合成失败: {str(e)}")


def main():
    parser = argparse.ArgumentParser(description='文本转语音')
    parser.add_argument('--txt', required=True, help='文本文件路径')
    parser.add_argument('--output', required=True, help='输出 wav 文件路径')
    parser.add_argument('--rate', type=int, default=150, help='语音速率(默认 150)')
    args = parser.parse_args()

    text_to_speech(args.txt, args.output, args.rate)


if __name__ == '__main__':
    main()
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 197kUpdated Claude CodeCodexVerifiedInstall