Text-to-speech (TTS) generation using MiniMax API. Converts text into natural-sounding speech with support for multiple voices, adjustable speed and pitch, and multiple audio formats (MP3/WAV/PCM). Use when the user wants to convert text to speech, generate voice narration, create audio from scripts, or convert articles/essays into audio.
⚠️ 需要具备 TTS/语音合成权限的 MiniMax API 密钥
- - 编程计划密钥(sk-cp-xxx)→ 不支持 TTS,仅限 M2.7 聊天模型
- 通用 API 密钥 → 请在 MiniMax 开放平台 确认您的订阅是否包含语音合成
- TTS 独立套餐: 访问 MiniMax 语音合成产品
使用 MiniMax 语音合成 API 进行文本转语音。支持 40+ 种语言、多种音色、可调节语速/音调以及多种音频格式。
bash
openclaw config set skills.entries.minimax-tts.apiKey sk-your-key
或添加到 openclaw.json 的技能条目中:
json
{
skills: {
entries: {
minimax-tts: {
apiKey: sk-your-key
}
}
}
}
bash
pip install requests
~/.openclaw/workspace/skills/minimax-tts/
├── SKILL.md
├── _meta.json
└── scripts/
└── minimax_tts.py
bash
python
from minimaxtts import generatespeech
名称: minimax_tts
输入模式:
json
{
type: object,
properties: {
text: {
type: string,
description: 要转换为语音的文本(每次请求最多 10000 字符)
},
model: {
type: string,
enum: [speech-2.8-hd, speech-2.6-hd, speech-02-hd],
default: speech-2.8-hd,
description: TTS 模型:speech-2.8-hd(推荐,高质量带情感控制),speech-2.6-hd(不支持编程计划),speech-02-hd(紧凑高清语音)
},
voice: {
type: string,
default: female-tianmei,
description: 音色 ID:female-tianmei, female-shaonv, female-yujie, female-chengshu, male-qn-qingse, male-qn-jingying, male-qn-badao, male-qn-daxuesheng
},
speed: {
type: number,
default: 1.0,
minimum: 0.5,
maximum: 2.0,
description: 语速,范围 0.5-2.0,默认 1.0
},
pitch: {
type: number,
default: 0,
minimum: -12,
maximum: 12,
description: 音调调节,范围 -12 到 12,默认 0
},
audio_format: {
type: string,
enum: [mp3, wav, pcm],
default: mp3,
description: 输出音频格式
},
output_path: {
type: string,
description: 音频保存路径。默认保存到 ~/.openclaw/workspace/tmp/tts_<时间戳>.mp3
}
},
required: [text]
}
输出: 包含成功状态和音频文件路径的 JSON
| voice_id | 描述 | 性别 |
|---|---|---|
| female-tianmei | 甜美女声 | 女 |
| female-shaonv |
对于多角色内容,创建 segments.json 文件并使用 --segments:
bash
python3 scripts/minimax_tts.py --segments segments.json --output combined.mp3
json
[
{
text: 清晨的阳光洒进了房间。,
voice: female-tianmei,
speed: 1.0
},
{
text: 欢迎收听今天的节目。,
voice: male-qn-qingse,
speed: 1.0
}
]
| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 1002 |
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 minimax-tts-generator-1775941621 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 minimax-tts-generator-1775941621 技能
skillhub install minimax-tts-generator-1775941621
文件大小: 7.68 KB | 发布时间: 2026-4-12 10:36