Chatterbox Voice Cloning
Clore.ai GPUs पर zero-shot voice cloning और multilingual speech synthesis के लिए Resemble AI द्वारा Chatterbox TTS चलाएँ।
अंतिम अपडेट
क्या यह उपयोगी था?
क्या यह उपयोगी था?
# PyPI से इंस्टॉल करें
pip install chatterbox-tts
# या स्रोत से इंस्टॉल करें
git clone https://github.com/resemble-ai/chatterbox.git
cd chatterbox
pip install -e .
# सत्यापित करें
python -c "from chatterbox.tts import ChatterboxTTS; print('Chatterbox ready')"import torchaudio as ta
from chatterbox.tts_turbo import ChatterboxTurboTTS
model = ChatterboxTurboTTS.from_pretrained(device="cuda")
# पैरालिंग्विस्टिक टैग्स के साथ बुनियादी TTS
text = "Hey, welcome back! [chuckle] I've got some great news for you today."
# वॉइस क्लोनिंग — 10+ सेकंड का संदर्भ क्लिप प्रदान करें
wav = model.generate(text, audio_prompt_path="reference_voice.wav")
ta.save("output_turbo.wav", wav, model.sr)
print(f"Saved at {model.sr} Hz")import torchaudio as ta
from chatterbox.tts import ChatterboxTTS
model = ChatterboxTTS.from_pretrained(device="cuda")
text = "The quick brown fox jumps over the lazy dog. It was a beautiful morning."
# वॉइस क्लोनिंग के बिना जनरेट करें (डिफ़ॉल्ट आवाज़ का उपयोग करता है)
wav = model.generate(text)
ta.save("output_default.wav", wav, model.sr)
# वॉइस क्लोनिंग के साथ जनरेट करें
wav = model.generate(text, audio_prompt_path="my_voice_sample.wav")
ta.save("output_cloned.wav", wav, model.sr)import torchaudio as ta
from chatterbox.mtl_tts import ChatterboxMultilingualTTS
model = ChatterboxMultilingualTTS.from_pretrained(device="cuda")
# फ्रेंच
french_text = "Bonjour, comment allez-vous? Bienvenue dans notre démonstration."
wav_fr = model.generate(french_text, language_id="fr")
ta.save("output_french.wav", wav_fr, model.sr)
# जापानी
japanese_text = "こんにちは、テキスト読み上げのデモンストレーションです。"
wav_ja = model.generate(japanese_text, language_id="ja")
ta.save("output_japanese.wav", wav_ja, model.sr)
# रूसी वॉइस क्लोनिंग के साथ
russian_text = "Привет! Это демонстрация синтеза речи на русском языке."
wav_ru = model.generate(
russian_text,
language_id="ru",
audio_prompt_path="russian_speaker.wav"
)
ta.save("output_russian.wav", wav_ru, model.sr)
print("Multilingual generation complete")import torchaudio as ta
from chatterbox.tts_turbo import ChatterboxTurboTTS
model = ChatterboxTurboTTS.from_pretrained(device="cuda")
samples = [
("greeting", "Hi there! [laugh] It's so good to see you again."),
("nervous", "Um, well [cough] I'm not really sure about that."),
("excited", "Oh my gosh! [chuckle] That's absolutely incredible news!"),
]
for name, text in samples:
wav = model.generate(text, audio_prompt_path="speaker_ref.wav")
ta.save(f"para_{name}.wav", wav, model.sr)
print(f"Generated: {name}")import torchaudio as ta
from chatterbox.tts import ChatterboxTTS
import os
model = ChatterboxTTS.from_pretrained(device="cuda")
# पंक्तियों की एक सूची को प्रोसेस करें (उदा., ऑडियोबुक अध्यायों के लिए)
lines = [
"Chapter one. The adventure begins.",
"It was a dark and stormy night.",
"The hero stood at the crossroads, uncertain of the path ahead.",
]
os.makedirs("output_batch", exist_ok=True)
for i, line in enumerate(lines):
wav = model.generate(line, audio_prompt_path="narrator_voice.wav")
ta.save(f"output_batch/line_{i:03d}.wav", wav, model.sr)
print(f"[{i+1}/{len(lines)}] {line[:40]}...")
print("Batch processing complete")