Dev.to AI 🤖 Ai 👁 0 📖 2 min read

How to Prepare a Voice Sample for AI Voice Cloning (and Check the Clone Actually Works)

Most failed AI voice clones come from a bad reference clip, not a bad model: silence at the start, a second speaker, clipping, or a transcript that does not match the audio. voice-clone-kit is an open-source (MIT) Agent

How to Prepare a Voice Sample for AI Voice Cloning (and Check the Clone Actually Works)

Most failed AI voice clones come from a bad reference clip, not a bad model: silence at the start, a second speaker, clipping, or a transcript that does not match the audio. voice-clone-kit is an open-source (MIT) Agent Skill with one small Python script that turns any recording into a clean cloning reference for the Miragea speech API and proves the result with a speech-recognition round trip. It needs only Python and ffmpeg.

Flow: prepare, transcribe, host, verify

1. Prepare the clip

git clone https://codeberg.org/miragea-voice/miragea-skills && cd miragea-skills
python3 skills/voice-clone-kit/scripts/clonekit.py prepare memo.m4a -o reference.wav

The script runs ffmpeg silencedetect, finds the longest run of speech between 8 and 25 seconds, and cuts only inside pauses so no word is clipped. The result is mono 24 kHz, high-passed at 70 Hz and loudness-normalised. The JSON report says in plain words if the clip is too short, too quiet, clipped or mostly pauses.

2. Get the exact words

export MIRAGEA_API_KEY=...   # create one at https://miragea.ai/workspace/api
python3 skills/voice-clone-kit/scripts/clonekit.py transcribe reference.wav

The cloning request takes reference_text, and it must match what is said. Read the transcript once and fix any slip.

3. Host it and verify

python3 skills/voice-clone-kit/scripts/clonekit.py host reference.wav      # temporary public URL
python3 skills/voice-clone-kit/scripts/clonekit.py verify \
  --reference-audio-url URL --reference-text "exact words" -o clone-test.mp3

verify speaks a test sentence in the cloned voice, transcribes it back and reports word_match. At 0.9 or higher the clone is intelligible; always listen to it too, because a transcript cannot judge timbre.

Real result

Real terminal output of prepare and verify

A 15.9 s voice memo with 3 s of silence on each side and fan noise became a 10 s reference, and a new sentence in that voice came back with a word match of 1.0. The files are in examples/voice-clone-kit.

Use it from an agent

Claude Code, Codex and Cursor can load it as a skill; the repo is on Codeberg: https://codeberg.org/miragea-voice/miragea-skills. Only clone voices you own or have permission to use.

FAQ

How long should a voice cloning sample be? About 10 to 20 seconds of one person talking clearly.

Can I use a video as the source? Yes, prepare drops the video and works on the audio track.

Is the upload private? No. host makes a temporary public link, so only upload samples you are happy to share.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.