gen-voice
สร้างเสียงพูดจากข้อความด้วย bunx TTS CLI
SKILL.mdgen-voice/SKILL.md
GitHubGoal
Generate a speech audio file from text with a TTS CLI
Scope
- Use
bunxCLIs for text-to-speech - Supports multiple languages and voices
- Supports output
.mp3,.wav,.ogg
Execute
1. Prepare Text
Goal: Have clear text
- Receive the text from the user or a file
- If the text is too long → split it into multiple chunks
- Specify the language (default auto-detect)
- Specify voice, speed, and output format
2. Choose CLI
Goal: Pick the TTS tool
- Primary:
bunx @pollinations/cli gen audio "<text>" --voice nova --output speech.mp3- No API key required
- Supports multiple voices
- Fallback:
bunx talk-tts "<text>" -o out.wav- Uses Kokoro, offline after download
- Supports 150+ voices
- Fallback:
bunx tts-cli "<text>" --save speech.mp3- Uses Microsoft Edge TTS
- Requires internet
- Fallback:
bunx @illyism/transcribeis not TTS (skip)
3. Generate Voice
Goal: Create the audio file
- Run the command with text, voice, and output
- Wait until it finishes
- Verify the output file size > 0
- If the language is wrong → add
--langand re-run
4. Validate
Goal: Check the audio
- Use
ffprobeorfileto verify the type - If it opens → report the duration
- Report the path, voice, and format
Rules
1. Language
- Use auto-detect when unspecified
- If the text mixes languages → split chunks or pick a voice that supports them
2. Chunks
- For long text → split into multiple files then concat with ffmpeg
- Never send text beyond the provider's limit
3. No Leaks
Never hardcode API keys
Use an environment variable or ask the user
Use /gen-subtitle-video if needed
Use /gen-media-ai-videos if needed
Expected Outcome
- A speech audio file generated from text
- The report includes path, voice, duration, and the tool used
- On failure, a fallback approach is given