Speech-to-Speech
S2S WebSocket Stream
Stream audio in and audio out over a single Gradium speech-to-speech WebSocket: transcribe, optionally translate, and re-synthesize in real time.
Lifecycle
ready, then text and audio messages as
available, and finally end_of_stream. The protocol combines the STT
input side (audio in) with the TTS output side (text and audio
out). See WebSocket Lifecycle for
connection behavior, reusable sockets, browser tokens, and errors.
Client Messages
setup
When using
pcm as input format, the input is expected to be at 24kHz using 16
bits little-endian samples. When using pcm as output format, the output is
expected to be at 48kHz using 16 bits little-endian samples.
audio
end_of_stream
Server Messages
ready
text
audio
Terminal messages
Error
Headers
Your Gradium API key
Response
101
WebSocket connection established