Streaming Migration Guide: Gladia to AssemblyAI
Streaming Migration Guide: Gladia to AssemblyAI
Streaming Migration Guide: Gladia to AssemblyAI
This guide walks through the process of migrating from Gladia to AssemblyAI for transcribing streaming audio.
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your AssemblyAI dashboard.
Below is a side-by-side comparison of a basic snippet to transcribe live audio by Gladia and AssemblyAI using a microphone:
For improved security, store your API key as an environment variable.
Helpful information about our streaming model:
Universal-3 Pro Model — Connect to wss://streaming.assemblyai.com/v3/ws with speech_model=u3-rt-pro to use our latest, highest-accuracy streaming model — Universal-3 Pro.
Built-in Formatting — Universal-3 Pro always returns formatted transcripts with smart punctuation & casing. No extra parameter is needed.
Partial Transcripts — AssemblyAI streams interim results automatically. Universal-3 Pro emits partials during periods of silence, with at most one partial per silence period.
Helpful information about AssemblyAI’s message payloads:
Clear Message Types – Instead of checking is_final, you’ll receive explicit "Begin", "Turn", and "Termination" events, making your logic simpler and more readable.
Session Metadata Up-Front – The first "Begin" message delivers a session_id and expiry timestamp so you can immediately log or surface these for tracing or billing.
End-of-Turn Detection – Each "Turn" object includes an end_of_turn boolean. When end_of_turn is true, the transcript is a final, formatted result. When false, it is a partial transcript. Universal-3 Pro always returns formatted transcripts with smart punctuation & casing built in.
Helpful information about AssemblyAI’s WebSocket Closure:
Helpful information to know about AssemblyAI’s shutdown:
JSON Payload Difference - When closing the stream with AssemblyAI, your JSON payload will be { "type": "Terminate" } instead of { "type": "stop_recording" }.
No Metadata Race Condition - AssemblyAI provides session info at “Begin” and doesn’t append extra data at shutdown, making the exit faster and less error-prone.
For additional information about using AssemblyAI’s Streaming Speech-To-Text API you can also refer to: