Tutorial

FireRedTTS usage guide from basic to advanced

1. Basic Text-to-Speech

Use the command line for basic text-to-speech:

python tts.py --text "Welcome to the FireRedTTS speech synthesis system" --output output.wav

2. Voice Cloning

Use reference audio for voice cloning:

python tts.py --text "This is cloned voice" --reference_audio reference.wav --output cloned_output.wav

3. Emotional Voice Generation

Generate voice with specific emotions:

python tts.py --text "I'm happy that the weather is nice today" --emotion happy --output happy_output.wav

4. API Calling Example

Use FireRedTTS API in Python:

from fireredtts import TTSModel

# Initialize the model
model = TTSModel()

# Generate speech
audio = model.synthesize(
    text="Welcome to FireRedTTS",
    speaker_reference="reference.wav",
    emotion="happy"
)

# Save audio
audio.save("output.wav")

5. Batch Processing

Batch process multiple texts:

python batch_tts.py --input texts.txt --output_dir ./outputs/

Advanced Features

Streaming Synthesis

Supports streaming speech synthesis, suitable for real-time application scenarios:

python stream_tts.py --text "This is a streaming synthesis example" --stream

Multilingual Mixing

Supports Chinese-English mixed text processing:

python tts.py --text "Welcome to FireRedTTS, Welcome to our system" --output mixed_output.wav

Custom Parameters

Adjust voice parameters to achieve ideal results:

python tts.py --text "Custom voice parameters" --speed 1.2 --pitch 0.8 --output custom_output.wav