Beta
Streaming Arabic PCM audio
Browse documentation
Audio format and response
The speech endpoint streams raw PCM in the response body: one channel, signed 16-bit little-endian samples. Set response_format to pcm. Do not send stream: true; the response already streams.
Read X-Sample-Rate from the response for playback. The default is 24,000 Hz. Network chunks need not align with complete samples; retain an incomplete byte for the next chunk.
To save WAV, add a valid WAV header after receiving the audio or convert it with an audio tool. Renaming the file does not convert it. With FFmpeg installed, the following plays the default output; change the rate if the response header differs.
ffplay -f s16le -ar 24000 -ac 1 speech.pcmIf the connection ends unexpectedly, do not treat partial audio as a complete recording. Check the HTTP status before reading audio and handle request errors using the error reference.
Speech parameters and examples