SuperAPI AI Directory

voice-clone

Coding & development

View repository

Updated 10-15 21:52

About this skill

Voice Clone

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:

  1. Confirm the reference audio and text source
  2. If the user directly provides long text, write it to a temporary text file
  3. Run python3 scripts/confucius4_tts.py
  4. Confirm that the output wav file exists and its size
  5. 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