StarModel invitation
← Back to skills
extension
Category: Content & MediaAPI key requirement unconfirmed

语音生成

语音生成

personAuthor: kissstronghubModelScope

Voice Generation

Generate human-like speech using free tools that require no API key.

  • edge-tts — pre-installed CLI, Microsoft neural voices (8 Chinese), fast, pitch/speed/volume control. Default for standard TTS.
  • VoxCPM2 — open source (面壁智能 × 清华大学, 38K+ stars). Voice creation from text description, 3s audio cloning, 48kHz, 30 languages.
  • MineCho 米可 — fully free. ~100 preset voices, 3 free voice-clone slots, short-video style.

Workflow

1. Classify the request

| Need | Best tool | Why | | - | - | - | | General TTS (read a script, standard voices) | edge-tts | Fastest, pre-installed | | Create a voice from a text description (e.g. "25岁女生,温柔沙哑") | VoxCPM2 | Core strength | | Clone a voice from a ~3s audio sample | VoxCPM2 or MineCho | VoxCPM2: unlimited; MineCho: 3 free slots | | Short-video dubbing / 短视频配音 | MineCho | Preset voices, internet style | | Multi-language TTS (30 languages) | VoxCPM2 | edge-tts only zh/en/ja/ko etc. | | Need pitch or volume adjustment | edge-tts | 5-level pitch + volume control |

Done when: the right tool is identified.

2. Get the input text

Ask the user how to provide the text (use question tool):

| Option | Description | | - | - | | Direct text | User types/pastes the text in the conversation | | TXT file | User provides a file path; read the file content |

For TXT files: read the file, show a preview (first 200 chars + total count), confirm with user before proceeding. Suggested limit: 5000 chars per generation.

Done when: the full text to be spoken is ready.

3. Ask the user for voice preference

Always ask the user before generating (unless they explicitly named a voice in their request). Use the question tool:

  1. Gender: Male or female?
  2. Specific voice: Based on gender, present available options:

edge-tts available voices (verified)

| Gender | Voice ID | Name | Style | Best for | | - | - | - | - | - | | 男 | zh-CN-YunxiNeural | 云希 | 活泼阳光 | 小说、叙事 | | 男 | zh-CN-YunjianNeural | 云健 | 激情运动 | 体育、热血 | | 男 | zh-CN-YunxiaNeural | 云夏 | 可爱卡通 | 动画、儿童 | | 男 | zh-CN-YunyangNeural | 云扬 | 专业可靠 | 新闻、商务 | | 女 | zh-CN-XiaoxiaoNeural | 晓晓 | 温暖自然 | 电台、情感 | | 女 | zh-CN-XiaoyiNeural | 晓伊 | 活泼卡通 | 短视频、轻松 | | 女 | zh-CN-liaoning-XiaobeiNeural | 小北(东北) | 幽默方言 | 趣味内容 | | 女 | zh-CN-shaanxi-XiaoniNeural | 小妮(陕西) | 明亮方言 | 地域特色 |

VoxCPM2 (text-description voices)

| Use case | Description template | | - | - | | Radio / 电台 | "30岁女性,声音温润,语速偏慢,带有轻微气声,夜晚电台风格" | | Documentary / 纪录片 | "45岁男性,低沉浑厚,语速适中,庄重克制,纪录片解说风格" | | Short video / 短视频 | "22岁女生,明亮活泼,语速偏快,元气感,短视频口播风格" | | Product ad | "30岁女性,清晰有活力,语速适中,自信从容,产品广告风格" | | Storytelling | "40岁女性,温柔叙事,语速偏慢,有画面感,睡前故事风格" | | News / 新闻 | "35岁男性,标准清晰,语速适中,客观中立,新闻播报风格" | | ASMR / 助眠 | "25岁女性,气声为主,语速很慢,轻柔,助眠风格" | | Sports / 体育 | "30岁男性,高亢有力,语速偏快,激情澎湃,赛事解说风格" | | Kids / 儿童 | "8岁男孩,稚嫩清亮,语速稍快,天真活泼,儿童故事风格" |

Full template table in references/tools.md.

If user says "随便" or doesn't care: default female → XiaoxiaoNeural, male → YunxiNeural.

The agent must NOT silently pick — always confirm unless user explicitly named a voice.

Done when: user has confirmed the voice.

4. Choose fine-tune settings (edge-tts only)

Ask or apply defaults. Use question tool to confirm:

Speed (语速)

| Level | Rate | Use case | | - | - | - | | 极慢 | -40% (0.6x) | 听写、学习 | | 较慢 | -20% (0.8x) | 听力练习 | | 正常 | +0% (1.0x) | 标准语速 | | 较快 | +20% (1.2x) | 快速浏览 | | 极快 | +50% (1.5x) | 倍速 |

Pitch (音调)

| Level | Pitch | Effect | | - | - | - | | 低沉 | -20Hz | 低音炮 | | 稍低 | -10Hz | 略低沉 | | 正常 | +0Hz | 默认 | | 稍高 | +10Hz | 略尖锐 | | 尖锐 | +20Hz | 高音 |

Volume (音量)

| Level | Volume | Effect | | - | - | - | | 静音 | -100% | 无声音 | | 较小 | -50% | 降低 | | 正常 | +0% | 默认 | | 较大 | +50% | 提高 | | 最大 | +100% | 最大 |

Default: all +0% / +0Hz. Only ask if user mentions wanting adjustments.

Done when: settings are decided (or defaults confirmed).

5. Preview (optional, edge-tts only)

Ask: "要先试听一下音色效果吗?"

If yes: generate a short preview (~3s) with the chosen voice and settings, save to a temp file, tell the user the path to listen. User confirms or changes voice before final generation.

edge-tts --voice <ID> --text "这是一段预览语音,您听听效果如何。" --rate <rate> --pitch <pitch> --volume <volume> --write-media _preview.mp3

Done when: user is satisfied (or skipped preview).

6. Set output file

Ask for output filename or use default voice-gen_<timestamp>.mp3 in current working directory.

Done when: output path is set.

7. Generate

edge-tts (default for standard TTS):

edge-tts --voice <VOICE_ID> --text "..." --rate <RATE> --pitch <PITCH> --volume <VOLUME> --write-media <OUTPUT>

PowerShell gotcha: negative values (-40%, -20Hz, -50%) must use = syntax or PowerShell treats them as flags:

# WRONG:  --rate -40%
# RIGHT:  "--rate=-40%"
# RIGHT:  "--pitch=-20Hz"

In bash/cmd, space-separated works fine.

For long text (>5000 chars), split into chunks, generate each, and note that the user can concatenate with:

ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mp3

Online demo (VoxCPM2):

  1. Open VoxCPM2 demo page.
  2. Paste text, enter voice description or upload 3s clone sample.
  3. Set language and speed. Generate, download.

Online demo (MineCho):

  1. Open MineCho web interface.
  2. Browse ~100 preset voices or use 3 free clone slots.
  3. Paste text, generate, download.

Local (VoxCPM2):

python {baseDir}/scripts/generate.py --text "..." --voice-desc "..." --language zh --speed 1.0 --output result.mp3

Done when: audio file is generated.

8. Verify

  • File exists and size is reasonable (not 0 bytes).
  • Voice matches the selected option.
  • No artifacts or unnatural pauses.
  • Language/pronunciation correct.

If unsatisfactory, adjust settings or re-pick voice and regenerate.

Done when: output is confirmed.

Pitfalls

  • edge-tts requires internet — it calls Microsoft's cloud TTS endpoint. No offline mode.
  • Only 8 Chinese voices actually exist — do NOT use voice IDs not in the table above (many older tutorials list non-existent voices like Xiaochen, Xiaohan, etc.).
  • Clone sample quality (VoxCPM2): 3s clean dry vocal, no noise/music/reverb.
  • Description specificity (VoxCPM2): "好听的声音" is too vague. Include age, gender, texture, mood.
  • MineCho limit: only 3 voice-clone slots total. Preset voices are unlimited.
  • Long scripts: split at paragraph boundaries, generate separately, stitch with ffmpeg.
  • Sample-rate mismatch: VoxCPM2 → 48kHz; edge-tts → 24kHz MP3. Downsample if needed for video editors.

Resources

  • edge-tts CLI (pre-installed) — primary tool, zero setup.
  • scripts/generate.py — local VoxCPM2 helper (requires VoxCPM2 installed).
  • references/tools.md — full tool comparison, voice templates, edge-tts parameter details.