Message Flow
Every TTS WebSocket session follows this pattern: For the full list of message types and parameters, see the WebSocket protocol reference.Quick Start
Connect, initialize a session, send text, and save the audio to a file. Both examples write aoutput.pcm file containing raw 16-bit PCM audio at 24 kHz. You can play it with ffplay:
More Examples
Batch Text Streaming
Send multiple sentences for smoother speech instead of one large block. This is a complete example you can run independently.Next Steps
Live TTS demo
Try real-time TTS in your browser, no setup needed
WebSocket protocol
Full message types, parameters, and error codes
TTS HTTP examples
Simpler integration for non-streaming use cases
TTS API reference
Endpoint-specific parameters