Method signature
Parameters
The text you want to convert to speech
The voice model to use for text-to-speech generation. You can get a list of all 49 available voice models using the
voice_models() methodReturns
The generated audio data in bytes format, decoded from base64data. You can save this to a file or play it directly
Example
Notes
- The method returns audio data in bytes format, which is automatically decoded from the base64data response
- The default voice model is
en-US_LisaExpressive - You can retrieve all available voice models using the
voice_models()method - The audio format is determined by the API and is suitable for direct playback or file storage