Use when the user wants to clone a voice from an audio sample. Pass reference audio URL to voice-clone, then synthesizes text with that voice via Giggle.pro. Before the blocking script run, tell the user clone is in progress; after it returns, forward URLs immediately—user need not ask for progress. Triggers: voice clone, clone my voice, clone voice from audio.
Clones a voice from a reference audio URL via giggle.pro. Flow: submit voice-clone with file.url directly → script polls until completed. Returns full signed audio URLs. Tell the user before the long-running exec that generation is in progress and you will return as soon as the script finishes (see Continuous progress updates).
API Key: Set system environment variable GIGGLE_API_KEY. Obtain it at giggle.pro while logged in: left sidebar → API Key (API 密钥). The script will prompt if not configured.
No inline Python: All commands must be executed via the
exectool. Never use heredoc inline code.
No Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
Voice cloning typically takes 1–3 minutes. The script submits voice-clone with file.url directly (no upload step), then polls for result.
Important: Never pass
GIGGLE_API_KEYin exec'senvparameter. API Key is read from system environment variable.
One exec runs the whole flow: submit + poll until done (--max-wait, default 180s). There is no separate --query loop for you to run.
--max-wait, explain and suggest retry or a different sample/voice_id.Before running, you must collect:
my_voice_001, minimax_testasds_02. If duplicate, API returns voice clone voice id duplicate.Before the command below, send the user the short preamble described above.
python3 scripts/voice_clone_api.py \
--audio-url "https://example.com/voice_sample.mp3" \
--text "A gentle breeze sweeps across the soft grass, carrying the fresh scent." \
--voice-id "my_unique_voice_01" \
--need-noise-reduction false \
--need-volumn-normalization false
Optional parameters:
--need-noise-reduction (default: false): Apply noise reduction to cloned audio--need-volumn-normalization (default: false): Apply volume normalizationSuccess: Script outputs the full signed audio URL(s). Forward to user as-is.
Failure:
voice clone voice id duplicate: Guide user to choose a different voice_idAudio links returned to the user must be full signed URLs (with Policy, Key-Pair-Id, Signature query params). Do not strip response-content-disposition=attachment when the API returns it. The script only normalizes ~ → %7E; keep URLs as-is when forwarding.
| Parameter | Required | Default | Description |
|---|---|---|---|
--audio-url | yes | - | Public URL of reference audio to clone |
--text | yes | - | Text to synthesize with cloned voice |
--voice-id | yes | - | User-defined unique voice identifier; must not duplicate existing |
--need-noise-reduction | no | false | Apply noise reduction |
--need-volumn-normalization | no | false | Apply volume normalization |
--max-wait | no | 180 | Max wait seconds for clone task |
When the user initiates voice clone:
voice_id for this clone (e.g. my_voice_001); it must not duplicate an existing clone."If voice_id duplicate: "That voice_id is already in use—please pick another unique id and try again."