Batch TTS

TTSResult — Response Object

The response from a batch synthesis request, containing the audio data and metadata.


Fields

FieldTypeDescription
audio_databytesDecoded audio bytes. Write directly to file or pass to a playback library.
sample_rateintAudio sample rate in Hz (e.g. 22050 for mp3, 8000 for mulaw).
formatstringOutput format string — matches the response_format set in TTSConfig.

Usage example

python
result = await client.tts.synthesize("Hello!", config=config)
result.save("output.mp3")          # Save to file
audio_bytes = result.audio_data    # Access raw bytes
print(result.sample_rate)          # e.g. 22050
print(result.format)               # e.g. "mp3"