mimo-tts-wav
/install mimo-tts-wav
MiMo TTS WAV 语音合成
调用小米 MiMo-V2.5-TTS 系列的 OpenAI 兼容 API,将文本合成为 WAV 音频文件。
前置条件
- 环境变量
MIMO_API_KEY已设置(从 xiaomimimo.com 获取) - Python 依赖:
openai,numpy,soundfile(如用流式)
使用方式
快速合成(非流式)
import os
from openai import OpenAI
import base64
client = OpenAI(
api_key=os.environ["MIMO_API_KEY"],
base_url="https://api.xiaomimimo.com/v1"
)
completion = client.chat.completions.create(
model="mimo-v2.5-tts",
messages=[
{"role": "user", "content": "用轻快活泼的语气读出这段文字"},
{"role": "assistant", "content": "你好,欢迎收听今天的节目。"}
],
audio={
"format": "wav",
"voice": "冰糖" # 预置音色
}
)
audio_bytes = base64.b64decode(completion.choices[0].message.audio.data)
with open("output.wav", "wb") as f:
f.write(audio_bytes)
可用模型
| Model ID | 功能 |
|---|---|
mimo-v2.5-tts |
预置音色合成(支持唱歌) |
mimo-v2.5-tts-voicedesign |
文本描述定制音色 |
mimo-v2.5-tts-voiceclone |
音频样本复刻音色 |
预置音色(mimo-v2.5-tts)
mimo_default(中国集群=冰糖,海外集群=Mia)冰糖(中文女声)茉莉(中文女声)苏打(中文男声)白桦(中文男声)Mia(英文女声)Chloe(英文女声)Milo(英文男声)Dean(英文男声)
风格控制
两种方式(二选一):
- 自然语言控制 → 写在
role: user的content中 - 音频标签控制 → 在
role: assistant的content中嵌入(风格)和[音频标签]
见 references/style-guide.md 获取详细风格标签列表。
脚本
scripts/tts_simple.py— 单次非流式合成 WAVscripts/tts_with_style.py— 带风格控制的合成示例scripts/tts_stream.py— 流式合成并拼接 WAV
运行方式:python scripts/tts_simple.py "要合成的文本"
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install mimo-tts-wav - After installation, invoke the skill by name or use
/mimo-tts-wav - Provide required inputs per the skill's parameter spec and get structured output
What is mimo-tts-wav?
小米 MiMo-V2.5-TTS 语音合成工具。将文本合成为 WAV 音频文件,支持预置音色、语音设计、音色克隆。使用 OpenAI SDK 调用 mimo-v2.5-tts / mimo-v2.5-tts-voicedesign / mimo-v2.5-tts-voiceclone 模型。需要 MIMO_API... It is an AI Agent Skill for Claude Code / OpenClaw, with 35 downloads so far.
How do I install mimo-tts-wav?
Run "/install mimo-tts-wav" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is mimo-tts-wav free?
Yes, mimo-tts-wav is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does mimo-tts-wav support?
mimo-tts-wav is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created mimo-tts-wav?
It is built and maintained by xcchenx345 (@xcchenx345); the current version is v1.0.0.