This Skill provides a complete wrapper for the MiniMax TTS API, supporting text-to-speech, voice cloning, and voice design features.
Quick Start
1. Environment Configuration
Make sure the environment variables are set:
export MINIMAX_API_KEY="your-api-key"
For detailed configuration instructions, see setup.md
2. Using the Python Module
import sys
import os
# 获取 skill 目录路径
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
Feature Overview
| Feature | Function | Description |
|---|---|---|
| Text-to-Speech | text_to_audio() |
Convert text to a speech file |
| List Voices | list_voices() |
Get the list of available voices |
| Voice Cloning | voice_clone() |
Clone a voice based on an audio file |
| Voice Design | voice_design() |
Generate a voice based on a text description |
| Play Audio | play_audio() |
Play an audio file |
Detailed Documentation
- Environment Configuration - API Key and dependency installation
- Text-to-Speech - Detailed explanation of TTS features
- Voice List - Available voices and filtering
- Voice Cloning - Clone a custom voice
- Voice Design - Generate a voice based on a description
Quick Examples
Text-to-Speech
text_to_audio(
text="你好,欢迎使用 MiniMax TTS 服务!",
voice_id="female-shaonv",
output_path="./hello.mp3"
)
List Available Voices
voices = list_voices(voice_type="system")
for voice in voices:
print(f"{voice['voice_id']}: {voice['name']}")
Voice Cloning
voice_clone(
voice_id="my-custom-voice",
audio_file="./sample.mp3",
voice_name="我的声音"
)
Voice Design
voice_design(
prompt="一个温柔的年轻女性声音,带有轻微的南方口音",
preview_text="你好,这是我的声音"
)
Supported Models
| Model | Description |
|---|---|
| speech-02-hd | HD version, best audio quality |
| speech-02-turbo | Fast version, low latency |
| speech-01-hd | Legacy HD |
| speech-01-turbo | Legacy Fast |
| speech-2.6-hd | Version 2.6 HD |
| speech-2.6-turbo | Version 2.6 Fast |
Common Voice IDs
System Preset Voices
female-shaonv- Young girl voicefemale-yujie- Mature woman voicefemale-chengshu- Mature female voicemale-qingnian- Young male voicemale-chengshu- Mature male voice
For more voices, use list_voices() to query.