MiniMax TTS 文字转语音模型,支持 speech‑02/01 系列,生成高质量语音,需使用 MINIMAX_API_KEY 环境变量。
使用 MiniMax TTS API 将文本转换为语音。
模型说明speech-02-hd高清语音,情感丰富speech-02-turbo高速语音speech-01-hd标准高清speech-01-turbo标准高速
pip3 install requestsMINIMAX_API_KEYbash
# 基本语音生成
python3 {baseDir}/scripts/tts.py --text "你好,欢迎使用MiniMax语音合成" --output hello.mp3
# 指定模型和声音
python3 {baseDir}/scripts/tts.py \
--model speech-02-hd \
--text "今天天气真不错" \
--voice_id female_healthy \
--output weather.mp3
# 英文语音
python3 {baseDir}/scripts/tts.py \
--model speech-02-hd \
--text "Hello, this is a test of MiniMax text to speech" \
--voice_id male_tianmei \
--output hello.mp3
参数说明默认值--model模型名称speech-02-hd``--text要转换的文本---voice_id声音 IDfemale_tianmei``--speed语速 (0.5-2.0)1.0--pitch音调调整0--volume音量 (0.5-2.0)1.0--emotion情感风格neutral``--language语言auto``--output输出文件路径output.mp3