MiniMax Speech 2.8 helper
- 1. Install dependencies. Run
pip install requests in the environment that will execute the script. The CLI talks to MiniMax's REST API, so you only need the requests library on top of Python 3.11+. - Set your MiniMax credential. Export
MINIMAX_API_KEY with the API key the user promised to supply. The script will refuse to run without it. - Use the bundled CLI.
scripts/minimax_tts.py exposes two subcommands:
-
tts: calls
POST https://api.minimax.io/v1/t2a_v2 (Speech 2.8 T2A HTTP) with the desired voice_id, voice settings, audio configuration, and optional voice effects. Example:
python scripts/minimax_tts.py tts \
--text "Tonight in Shenzhen the skies are clear." \
--voice-id "Sweet_Girl_2" \
--model speech-2.8-hd \
--audio-format mp3 \
--output minimax-weather.mp3
The script decodes the hex/base64 payload, saves the file, and prints metadata. Override the endpoint with
--endpoint if you must hit
https://api-uw.minimax.io/v1/t2a_v2 or another region.
-
voices: calls
POST https://api.minimax.io/v1/get_voice to enumerate
system,
voice_cloning,
voice_generation, or
all categories. Example:
python scripts/minimax_tts.py voices --voice-type all --print-response
- 4. Customize TTS payloads via CLI switches. Use
--speed, --vol, --pitch, and --language-boost to shape the voice. Control audio fidelity with --sample-rate, --bitrate, --audio-format, and --channel. Add pronunciation overrides (--pronunciation "emoji=ee-moh-jee") or mix timbres (--timbre-weight "Sweet_Girl_2=0.8"). --voice-modify-* flags let you nudge pitch/intensity/timbre or append a sound effect such as "spacious_echo". --output-format tells the script how the API returns audio (hex, base64, or a download url). - Handle the JSON. By default the script prints the
extra_info field so you can read bitrate/sample rate/length. Use --print-response on either subcommand to dump the entire API payload for debugging. Save catalog JSON to disk with --output <path> when you need to reference voices later.
Keep this skill loaded any time you are asked for MiniMax-specific voices or when precise speech settings are required. The CLI gives you deterministic control over voice_id, model, and audio quality so you always get the Sweet_Girl_2 (or any other) tone you expect. If you need to script these requests from another tool, copy the relevant requests.post logic from scripts/minimax_tts.py.
技能名称: minimax-tts
详细描述:
MiniMax Speech 2.8 辅助工具
- 1. 安装依赖。 在将要执行脚本的环境中运行 pip install requests。该命令行工具与 MiniMax 的 REST API 通信,因此除了 Python 3.11+ 之外,你只需要 requests 库。
- 设置你的 MiniMax 凭证。 使用用户承诺提供的 API 密钥导出 MINIMAXAPIKEY。如果没有该密钥,脚本将拒绝运行。
- 使用捆绑的命令行工具。 scripts/minimax_tts.py 提供了两个子命令:
- tts:使用所需的 voice
id、语音设置、音频配置以及可选的语音效果,调用 POST https://api.minimax.io/v1/t2av2(Speech 2.8 T2A HTTP)。示例:
bash
python scripts/minimax_tts.py tts \
--text 今晚深圳的天空晴朗。 \
--voice-id Sweet
Girl2 \
--model speech-2.8-hd \
--audio-format mp3 \
--output minimax-weather.mp3
脚本会解码十六进制/base64 负载,保存文件,并打印元数据。如果你必须访问 https://api-uw.minimax.io/v1/t2a_v2 或其他区域,可以使用 --endpoint 覆盖端点。
- voices:调用 POST https://api.minimax.io/v1/getvoice 来枚举 system、voicecloning、voice_generation 或 all 类别。示例:
bash
python scripts/minimax_tts.py voices --voice-type all --print-response
- 4. 通过命令行开关自定义 TTS 负载。 使用 --speed、--vol、--pitch 和 --language-boost 来塑造语音。使用 --sample-rate、--bitrate、--audio-format 和 --channel 控制音频保真度。添加发音覆盖(--pronunciation emoji=ee-moh-jee)或混合音色(--timbre-weight SweetGirl2=0.8)。--voice-modify-* 标志允许你微调音高/强度/音色,或附加音效,例如 spaciousecho。--output-format 告诉脚本 API 如何返回音频(hex、base64 或下载 url)。
- 处理 JSON。 默认情况下,脚本会打印 extrainfo 字段,以便你可以读取比特率/采样率/长度。在任何子命令中使用 --print-response 来转储整个 API 负载以进行调试。当你以后需要引用语音时,使用 --output 将目录 JSON 保存到磁盘。
每当被问及 MiniMax 特定语音或需要精确语音设置时,请保持此技能加载。该命令行工具让你能够确定性地控制 voiceid、模型和音频质量,从而始终获得你期望的 SweetGirl2(或任何其他)音调。如果你需要从其他工具编写这些请求的脚本,请从 scripts/minimaxtts.py 复制相关的 requests.post 逻辑。