Skip to main content
The ASR service transcribes audio to text using on-device models running fully on the Qualcomm NPU. It supports both file-based batch transcription and real-time streaming via WebSocket.

Prerequisites

Ensure the Audio Analytics container is deployed and running. See Running the Audio Analytics container for setup instructions.

Audio format requirements

Available models

Query the models endpoint to get the list of available ASR models:
Response:
Use the name value from this response in your transcription requests.

Endpoints

File transcription

Upload a WAV file and receive the complete transcription in a single response:
Response:
Set language to a language code supported by the model, or omit it for automatic detection.

File transcription with streaming results

Upload a complete WAV file and receive transcription results via WebSocket as the file is processed:
The server acknowledges the upload and begins processing. Connect to the WebSocket to receive results. WebSocket results:

Live audio streaming

Stream raw audio chunks in real time and receive transcription results as you speak.

Step 1 - Create a session

Declare the audio format via parameters if your audio is not 16 kHz mono PCM:
Response:
The vad parameter sets the silence hangover in milliseconds before speech end is detected. Omit it to disable VAD and manage utterance end manually via /transcriptions/flush or /transcriptions/close.

Step 2 - Connect to WebSocket and send audio

Connect to ws://localhost:8085/stream. The server sends a connection_established message on connect before any transcription messages arrive:
Send audio in 8192-byte chunks via WebSocket:

Step 3 - Receive results

The server emits the following sequence per utterance:
After transcript.text.done the engine resets and listens for the next utterance. The session stays open until you call /transcriptions/close.

Step 4 - Close the session

Response:
Only one ASR session can be active at a time. Starting a second session while one is active returns HTTP 409 Conflict. Close the existing session first.

Voice Activity Detection (VAD)

VAD controls how the server detects the end of an utterance during a streaming session. When silence is detected for the configured duration, the server emits speech_end followed by transcript.text.done for the current utterance. The session remains open and resets for the next utterance — VAD does not close the session.
If no audio is received for the duration set by SESSION_TIMEOUT_S (default: 30 seconds) in the container config, the session closes automatically regardless of VAD state.

Flush buffered audio

Force immediate transcription of buffered audio without closing the session:

Python example

Troubleshooting

Poor transcription quality: Use 16 kHz mono WAV files and ensure audio is clear with minimal background noise.

Next steps

Text-to-speech

Synthesize speech from text on-device

Language translation

Translate text between languages on-device