tts-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMiniMax TTS Skill
MiniMax TTS Skill
这个 Skill 提供 MiniMax TTS API 的完整封装,支持文本转语音、声音克隆和声音设计功能。
This Skill provides a complete wrapper for the MiniMax TTS API, supporting text-to-speech, voice cloning, and voice design features.
快速开始
Quick Start
1. 环境配置
1. Environment Configuration
确保已设置环境变量:
bash
export MINIMAX_API_KEY="your-api-key"详细配置说明见 setup.md
Ensure the environment variable is set:
bash
export MINIMAX_API_KEY="your-api-key"For detailed configuration instructions, see setup.md
2. 使用 Python 模块
2. Using the Python Module
python
import sys
import ospython
import sys
import os获取 skill 目录路径
Get skill directory path
skill_dir = os.path.dirname(os.path.abspath(file))
sys.path.insert(0, os.path.join(skill_dir, "assets"))
from minimax_tts import text_to_audio, list_voices, voice_clone, voice_design, play_audio
undefinedskill_dir = os.path.dirname(os.path.abspath(file))
sys.path.insert(0, os.path.join(skill_dir, "assets"))
from minimax_tts import text_to_audio, list_voices, voice_clone, voice_design, play_audio
undefined功能概览
Feature Overview
| 功能 | 函数 | 说明 |
|---|---|---|
| 文本转语音 | | 将文本转换为语音文件 |
| 列出声音 | | 获取可用的声音列表 |
| 声音克隆 | | 基于音频文件克隆声音 |
| 声音设计 | | 根据文字描述生成声音 |
| 播放音频 | | 播放音频文件 |
| Feature | Function | Description |
|---|---|---|
| Text-to-Speech | | Convert text to audio files |
| List Voices | | Get the list of available voices |
| Voice Cloning | | Clone voices based on audio files |
| Voice Design | | Generate voices based on text descriptions |
| Play Audio | | Play audio files |
详细文档
Detailed Documentation
- 环境配置 - API Key 和依赖安装
- 文本转语音 - TTS 功能详解
- 声音列表 - 可用声音和筛选
- 声音克隆 - 克隆自定义声音
- 声音设计 - 根据描述生成声音
- Environment Configuration - API Key and dependency installation
- Text-to-Speech - Detailed TTS feature explanation
- Voice List - Available voices and filtering
- Voice Cloning - Clone custom voices
- Voice Design - Generate voices based on descriptions
快速示例
Quick Examples
文本转语音
Text-to-Speech
python
text_to_audio(
text="你好,欢迎使用 MiniMax TTS 服务!",
voice_id="female-shaonv",
output_path="./hello.mp3"
)python
text_to_audio(
text="Hello, welcome to the MiniMax TTS service!",
voice_id="female-shaonv",
output_path="./hello.mp3"
)列出可用声音
List Available Voices
python
voices = list_voices(voice_type="system")
for voice in voices:
print(f"{voice['voice_id']}: {voice['name']}")python
voices = list_voices(voice_type="system")
for voice in voices:
print(f"{voice['voice_id']}: {voice['name']}")声音克隆
Voice Cloning
python
voice_clone(
voice_id="my-custom-voice",
audio_file="./sample.mp3",
voice_name="我的声音"
)python
voice_clone(
voice_id="my-custom-voice",
audio_file="./sample.mp3",
voice_name="My Voice"
)声音设计
Voice Design
python
voice_design(
prompt="一个温柔的年轻女性声音,带有轻微的南方口音",
preview_text="你好,这是我的声音"
)python
voice_design(
prompt="A gentle young female voice with a slight southern accent",
preview_text="Hello, this is my voice"
)支持的模型
Supported Models
| 模型 | 说明 |
|---|---|
| speech-02-hd | 高清版本,音质最佳 |
| speech-02-turbo | 快速版本,延迟低 |
| speech-01-hd | 旧版高清 |
| speech-01-turbo | 旧版快速 |
| speech-2.6-hd | 2.6 版高清 |
| speech-2.6-turbo | 2.6 版快速 |
| Model | Description |
|---|---|
| speech-02-hd | HD version, best sound quality |
| speech-02-turbo | Fast version, low latency |
| speech-01-hd | Legacy HD version |
| speech-01-turbo | Legacy fast version |
| speech-2.6-hd | Version 2.6 HD |
| speech-2.6-turbo | Version 2.6 fast |
常用声音 ID
Common Voice IDs
系统预设声音
System Preset Voices
- - 少女音
female-shaonv - - 御姐音
female-yujie - - 成熟女声
female-chengshu - - 青年男声
male-qingnian - - 成熟男声
male-chengshu
更多声音请使用 查询。
list_voices()- - Young girl voice
female-shaonv - - Sophisticated mature female voice
female-yujie - - Mature female voice
female-chengshu - - Young male voice
male-qingnian - - Mature male voice
male-chengshu
For more voices, please use to query.
list_voices()