TTS
- pipecat.services.xtts.tts.language_to_xtts_language(language)[source]
- Parameters:
language (Language)
- Return type:
str | None
- class pipecat.services.xtts.tts.XTTSService(*, voice_id, base_url, aiohttp_session, language=Language.EN, sample_rate=None, **kwargs)[source]
Bases:
TTSService
- Parameters:
voice_id (str)
base_url (str)
aiohttp_session (ClientSession)
language (Language)
sample_rate (int | None)
- can_generate_metrics()[source]
- Return type:
bool
- language_to_service_language(language)[source]
Convert a language to the service-specific language format.
- Parameters:
language (Language) – The language to convert.
- Returns:
The service-specific language identifier, or None if not supported.
- Return type:
str | None
- async start(frame)[source]
Start the TTS service.
- Parameters:
frame (StartFrame) – The start frame containing initialization parameters.
- async run_tts(text)[source]
Run text-to-speech synthesis on the provided text.
This method must be implemented by subclasses to provide actual TTS functionality.
- Parameters:
text (str) – The text to synthesize into speech.
- Yields:
Frame – Audio frames containing the synthesized speech.
- Return type:
AsyncGenerator[Frame, None]