streaming: true is set in your request, the API returns audio data in chunks as it’s generated.
Audio Format
Streaming responses return raw PCM audio data:- Format: PCM (Pulse Code Modulation)
- Sample Rate: 24000 Hz
- Channels: Mono
- Bit Depth: 16-bit
How It Works
When streaming is enabled:- The API starts generating audio immediately
- Audio chunks are sent as they become available
- You can begin playback before generation completes
- Lower latency compared to non-streaming requests
Example
Handling Streaming Responses
Process the streaming PCM data in your application:- Save chunks to a buffer
- Play audio chunks as they arrive
- Convert PCM to your desired format (WAV, MP3, etc.) if needed