Batch TTS
TTSResult — Response Object
The response from a batch synthesis request, containing the audio data and metadata.
Fields
| Field | Type | Description |
|---|---|---|
audio_data | bytes | Decoded audio bytes. Write directly to file or pass to a playback library. |
sample_rate | int | Audio sample rate in Hz (e.g. 22050 for mp3, 8000 for mulaw). |
format | string | Output 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"