From 6b4f66dcf5b219d2a05d11c32137fae5f07f1fb5 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Mon, 26 Jan 2026 16:28:39 -0500 Subject: [PATCH] Use LJ Speech sample for voice cloning (Alibaba Cloud URL blocked) --- scripts/download_voice_samples.sh | 70 +++++++++++++++++++++++++++++++ voice_to_speaker.default.yaml | 27 ++++++------ 2 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 scripts/download_voice_samples.sh diff --git a/scripts/download_voice_samples.sh b/scripts/download_voice_samples.sh new file mode 100644 index 0000000..66924c4 --- /dev/null +++ b/scripts/download_voice_samples.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Download voice samples for Qwen3-TTS voice cloning +# Uses LibriSpeech test-clean samples (CC BY 4.0) + +set -e + +VOICES_DIR="${1:-voices/samples}" +mkdir -p "$VOICES_DIR" + +echo "Downloading voice samples for Qwen3-TTS cloning..." + +# LibriSpeech test-clean has good quality samples with transcripts +# We'll use samples from different speakers for variety + +# Download a small subset from HuggingFace +# These are curated samples for the 6 OpenAI-compatible voice types: +# - alloy: neutral/balanced +# - echo: male, clear +# - fable: expressive/storyteller +# - onyx: deep male +# - nova: female, warm +# - shimmer: female, soft + +# Using LibriVox/LibriSpeech samples (public domain audiobooks) +# Format: Speaker reads a passage, we take a clean 3-10 second clip + +cat << 'EOF' +Voice samples need to be: +- 3-10 seconds of clear speech +- Single speaker, no background noise +- WAV format (16kHz or higher) +- With exact transcript + +Recommended sources: +1. LibriSpeech test-clean: https://www.openslr.org/12 +2. VCTK: https://datashare.ed.ac.uk/handle/10283/3443 +3. LJ Speech: https://keithito.com/LJ-Speech-Dataset/ + +For now, using Qwen's demo sample for all voices. +To add distinct voices, place WAV files in voices/samples/ and update +config/voice_to_speaker.yaml with paths and transcripts. + +Example voice_to_speaker.yaml entry: + alloy: + ref_audio: voices/samples/alloy.wav + ref_text: "The exact words spoken in the audio file." + language: English +EOF + +# Download LJ Speech sample (public domain) since Qwen's Alibaba Cloud URL is blocked +echo "Downloading LJ Speech sample..." +curl -L -o "$VOICES_DIR/lj_speech.wav" \ + "https://github.com/coqui-ai/TTS/raw/main/tests/data/ljspeech/wavs/LJ001-0001.wav" 2>/dev/null || \ + echo "Failed to download LJ Speech sample" + +# Check if we have the sample +if [ -f "$VOICES_DIR/lj_speech.wav" ]; then + echo "Downloaded: $VOICES_DIR/lj_speech.wav" + echo "Transcript: 'Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition'" +else + echo "Warning: Could not download voice sample" +fi + +echo "" +echo "To add more voices, you can:" +echo "1. Record your own samples (3-10 seconds, clear speech)" +echo "2. Download from LibriSpeech: https://www.openslr.org/12" +echo "3. Use VCTK dataset: https://datashare.ed.ac.uk/handle/10283/3443" +echo "" +echo "Then update config/voice_to_speaker.yaml with the paths and transcripts." diff --git a/voice_to_speaker.default.yaml b/voice_to_speaker.default.yaml index 22706d9..0c9bc82 100644 --- a/voice_to_speaker.default.yaml +++ b/voice_to_speaker.default.yaml @@ -6,40 +6,41 @@ tts-1-qwen: # Each voice requires ref_audio (reference audio) and ref_text (transcript of the audio) # Language: Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian - # Default voice - using Qwen's example clone audio + # Default voice - using LJ Speech sample (public domain) + # Original Qwen demo URL (https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav) is blocked alloy: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Echo - same sample, different name for compatibility echo: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Fable - same sample fable: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Onyx - same sample onyx: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Nova - same sample nova: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Shimmer - same sample shimmer: - ref_audio: https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen3-TTS-Repo/clone.wav - ref_text: "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it!" + ref_audio: voices/samples/lj_speech.wav + ref_text: "Printing, in the only sense with which we are at present concerned, differs from most if not from all the arts and crafts represented in the Exhibition" language: English # Custom voice example - add your own reference audio