Purpose
Use the Confucius4-TTS online Demo API to synthesize text into speech in a reference voice.
Default reference voice:
assets/miss-arrogant.mp3
Quick Start
Run in this Skill directory:
python3 scripts/confucius4_tts.py --text "你好,这是一次声音克隆测试。" --out output.wav
Use a text file:
python3 scripts/confucius4_tts.py --text-file input.txt --out output.wav
Specify a reference voice:
python3 scripts/confucius4_tts.py \
--reference /path/to/reference.mp3 \
--text-file input.txt \
--out output.wav
Parameters
| Parameter | Default | Description |
|---|---|---|
--text <text> |
empty | Text to synthesize |
--text-file <path> |
empty | Read the text to synthesize from a file |
--reference <path> |
assets/miss-arrogant.mp3 |
Reference voice |
--lang <code> |
zh |
Language code |
--out <path> |
voice-clone-output.wav |
Output audio |
--base-url <url> |
Confucius4-TTS Demo | Gradio service address |
--text and --text-file one must be provided; if both are provided, --text。
Agent Workflow
When the user wants to synthesize speech:
- Confirm the reference audio and text source
- If the user directly provides long text, write it to a temporary text file
- Run
python3 scripts/confucius4_tts.py - Confirm that the output wav file exists and its size
- Report the output path back to the user
Notes
- This script depends only on the Python standard library and calls the public Gradio Demo; no API Key is required
- The remote end may queue, rate-limit, or be temporarily unavailable