‹ 首页

google-tts

@sanjay3290 · 收录于 1 周前

Convert documents and text to audio using Google Cloud Text-to-Speech. Use this skill when the user wants to: narrate a document, read aloud text, generate audio from a file, convert text to speech, create a recording of documentation or analysis, create a podcast from a document, or use Google TTS/text-to-speech. Trigger phrases: "read this aloud", "narrate this", "create a recording", "text to speech", "TTS", "convert to audio", "audio from document", "listen to this", "generate audio", "google tts", "create a podcast".

适合你,如果需要将文字内容转为语音文件

/ 下载安装
google-tts.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add sanjay3290/ai-skills/google-tts
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- sanjay3290/ai-skills/google-tts
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify sanjay3290/ai-skills/google-tts
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
335GitHub stars
~802最小装载
~802含声明引用
~6.3K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · Apache-2.0 · cde1c83

Google Cloud Text-to-Speech

Converts text and documents into audio using Google Cloud TTS API. Supports Neural2, WaveNet, Studio, and Standard voices across 40+ languages.

Setup

API key via GOOGLE_TTS_API_KEY env var or skills/google-tts/config.json with {"api_key": "..."}. Requires ffmpeg for multi-chunk documents. Optional: pip install PyPDF2 python-docx for PDF/DOCX.

Commands
List Voices
python skills/google-tts/scripts/google_tts.py voices --language en-US --type Neural2
python skills/google-tts/scripts/google_tts.py voices --json
Text-to-Speech
# From text or document (PDF, DOCX, MD, TXT)
python skills/google-tts/scripts/google_tts.py tts --text "Hello world" --output ~/Downloads/hello.mp3
python skills/google-tts/scripts/google_tts.py tts --file /path/to/doc.pdf --output ~/Downloads/narration.mp3

# With voice, rate, pitch, encoding options
python skills/google-tts/scripts/google_tts.py tts --file doc.md --voice en-US-Neural2-F --rate 0.9 --encoding MP3 --output ~/Downloads/out.mp3
Podcast Generation

Takes a JSON script with alternating speakers, synthesizes each with a different voice.

[
  {"speaker": "host1", "text": "Welcome to our podcast!"},
  {"speaker": "host2", "text": "Thanks for having me..."}
]
python skills/google-tts/scripts/google_tts.py podcast --script /tmp/script.json --output ~/Downloads/podcast.mp3
python skills/google-tts/scripts/google_tts.py podcast --script /tmp/script.json --voice1 en-US-Neural2-J --voice2 en-US-Neural2-H --rate 0.9 --output ~/Downloads/podcast.mp3
Workflow
Single-Voice Narration
  1. If user provides a file path, use --file. For generated content, write clean prose to /tmp/tts_input.md first.
  2. Default voice: en-US-Neural2-D (male) or en-US-Neural2-F (female). Use Neural2 for best quality/cost balance.
  3. Generate: python skills/google-tts/scripts/google_tts.py tts --file /tmp/tts_input.md --output ~/Downloads/recording.mp3
  4. Report file location and size. Default output to ~/Downloads/.
Podcast from Document
  1. Extract text: python skills/google-tts/scripts/extract.py /path/to/document.pdf
  2. Generate a two-host conversation script as JSON:
  3. Natural discussion, not verbatim reading. Host 1 leads, Host 2 reacts/analyzes.
  4. Include intro and outro. Vary turn lengths. Keep turns under 4000 chars.
  5. Write script to /tmp/podcast_script.json
  6. Generate: python skills/google-tts/scripts/google_tts.py podcast --script /tmp/podcast_script.json --output ~/Downloads/podcast.mp3
  7. Clean up temp files.
Reference
  • Recommended voice type: Neural2 (~$4/1M chars, high quality)
  • Speaking rate: 0.25-4.0 (0.85-0.95 good for technical content)
  • Pitch: -20.0 to 20.0 semitones
  • Encodings: MP3 (default), LINEAR16 (.wav), OGG_OPUS (.ogg)
  • API limit: 5000 bytes/request. Script auto-chunks at sentence boundaries.
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。