Skip to main content

Real-time Speech to Text

Stream live audio and receive transcripts as speech occurs via WebSocket.

How It Works

There is no separate session-creation REST call. You connect directly to the WebSocket gateway, pass your token and language as query parameters, send {"action": "start"}, then stream PCM audio as binary frames.

Discover languages → Connect WebSocket → Start → Stream audio → Receive transcripts → Stop
note

WebSocket sessions are asynchronous. For best results, use coroutines or a dedicated thread for sending audio and a separate one for receiving messages.

tip

Call GET /api/v3/speech_to_text/realtime/languages to retrieve the language codes available to your organization before opening a socket.

Quick Start

1. Discover available languages

curl -H "x-zoom-s2t-key: YOUR_TOKEN" \
https://api.scriptix.io/api/v3/speech_to_text/realtime/languages
{
"result": {
"languages": ["da", "de", "en", "es", "fi", "fr", "it", "nl", "ru", "sv", "uk"]
}
}

2. Open a WebSocket connection

wss://realtime.scriptix.io/v2/realtime?language=en&token=YOUR_REALTIME_TOKEN

The language parameter is required. See WebSocket Connection for all options.

3. Start the session

Once the socket is open, send:

{"action": "start"}

The server responds when ready:

{"state": "listening"}

4. Stream audio

Send PCM WAVE mono 16 kHz as binary WebSocket frames. See Audio Formats for encoding details and recommended chunk sizes.

5. Receive transcripts

Results arrive as JSON:

{
"result": [
["Hello", 0, 480, 0.99],
["world", 480, 960, 0.98]
],
"text": "Hello world"
}

Each word entry is [word, time_start_ms, time_end_ms, confidence].

6. Stop the session

{"action": "stop"}

The server drains any remaining audio and closes with:

{"state": "stopped"}

Supported Languages

Call /realtime/languages to get the current list of available language codes. Do not hard-code the list; availability can differ by organization.

Next Steps