Loading...
Loading...
Text-to-Speech Tool - Supports script parsing, emotion tagging, and post-processing, based on Edge TTS
npx skill4agent add wlzh/skills text-to-speech# Basic usage
python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py <text-file>
# Specify output file
python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py script.txt -o output.mp3
# Specify voice
python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py script.txt -v zh-CN-XiaoxiaoNeural
# Enable post-processing (voice-changer)
python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py script.txt --post-process
# List all available voices
python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py --list-voices(00:00)[BGM渐入:...](主播声音:...)(停顿 1秒)(语速放慢,加重语气)**文本**--rate "+20%"--rate "-10%"--pitch "+5Hz"--pitch "-3Hz"--volume "+20%"--volume "-10%"~/.claude/skills/text-to-speech/config/tts_config.json{
"edge_tts": {
"voice": "zh-CN-YunyangNeural",
"rate": "+0%",
"pitch": "+0Hz",
"volume": "+0%"
},
"script_parsing": {
"enabled": true,
"remove_timestamps": true,
"remove_bgm_notes": true,
"remove_stage_directions": true,
"remove_markdown": true
},
"emotion_processing": {
"enabled": true,
"use_ssml": true
},
"output": {
"format": "mp3",
"default_output_dir": "same_as_input",
"filename_suffix": "_tts"
},
"post_processing": {
"enabled": false,
"voice_changer": {
"enabled": false,
"voice_type": "female_1",
"pitch_shift": 0
}
}
}Input Text/File
↓
Script Parsing (remove comments and tags)
↓
Emotion Tag Processing (optional)
↓
Edge TTS Speech Synthesis
↓
Post-Processing (voice-changer, optional)
↓
Output MP3 File# Install Edge TTS
pip install edge-tts
# If post-processing is needed, ensure voice-changer skill is installedpython3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py podcast_script.txtpodcast_script_tts.mp3python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py script.txt \
-v zh-CN-XiaoxiaoNeural \
--rate "+10%"python3 ~/.claude/skills/text-to-speech/scripts/text_to_speech.py script.txt \
--post-process