基于 Edge TTS(Microsoft Azure 语音)的文本转语音,免费且无需 API 密钥,支持 100+ 种语音,覆盖 50+ 种语言(包括中文和英文)
Use to convert text to speech using Microsoft Edge's free TTS service. No API key required.
VoiceGenderStylezh-CN-XiaoxiaoNeuralFemaleWarm, natural (default)zh-CN-YunxiNeuralMaleYoung, casualzh-CN-YunjianNeuralMaleProfessional, newszh-CN-XiaoyiNeuralFemaleCute, youngzh-CN-YunyangNeuralMaleNews broadcasterzh-CN-XiaochenNeuralFemaleChildzh-TW-HsiaoChenNeuralFemaleTraditional Chinese
VoiceGenderStyleen-US-JennyNeuralFemaleFriendly (default)en-US-GuyNeuralMaleProfessionalen-GB-SoniaNeuralFemaleBritish
bash
{baseDir}/scripts/tts.py --text "Hello world" --output /tmp/output.mp3
OptionDefaultDescription--text(required)Text to speak--voicezh-CN-XiaoxiaoNeuralVoice ID--output/tmp/tts_output.mp3Output file path--rate0%Speed adjustment (-50% to +100%)--pitch0HzPitch adjustment (-50Hz to +50Hz)--volume0%Volume adjustment (-100% to +100%)--fileRead text from file instead of --text
bash
# Basic Chinese TTS
{baseDir}/scripts/tts.py --text "你好,我是Nova" --output /tmp/hello.mp3
# Male voice, faster speech
{baseDir}/scripts/tts.py --text "Hello world" --voice en-US-GuyNeural --rate +20% --output /tmp/fast.mp3
# Read from file
{baseDir}/scripts/tts.py --file script.txt --output /tmp/script.mp3
List all voices:
bash
{baseDir}/scripts/tts.py --list-voices zh
{baseDir}/scripts/tts.py --list-voices en
{baseDir}/scripts/tts.py --list-voices ja
edge-tts (pip install)