TTS#

pydantic model TTS[source]#

Bases: BaseTTS

Multilingual text-to-speech using the Google TTS API

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field audio_config: AudioConfig | None = None#

Audio config for return encoding type (MP3)

field client: TextToSpeechClient | None = None#

Google TTS client

field language: str [Required]#

TTS input language name [see Supported Languages]

field voice_gender: int = SsmlVoiceGender.NEUTRAL#

TTS voice gender

run(tts_input: str) → None[source]#

Convert tts to audio and output to speaker

property voice: VoiceSelectionParams#

Select TTS voice from language and gender