Live Transcription (Websocket)
Stream raw audio to CAMB over a single WebSocket and receive cumulative interim transcripts, word-level timing, and typed events.
WSS
Beta. The live transcription WebSocket is generally available for
testing but the schema, event shape, and error codes may change in
backwards-incompatible ways before GA. Pin to the SDK versions you
test against.
What you get back
After connect, the server emits a singleReady event, then streams
Results messages as your audio is consumed. Each Results carries the
cumulative transcript for the current utterance — replace your
in-progress UI state with it rather than concatenating.
The is_final flag tells interim refinements (false) apart from the
frame that finalizes an utterance (true). After a final, the next
Results starts a brand-new utterance from an empty string — so if
you only ever overwrite your UI with the latest transcript, each new
utterance erases the previous one. Show the interim frames as a live
preview, then commit the text when is_final is true (the server also
emits an UtteranceEnd boundary marker around the same point).
Word-level timing (channel.alternatives[0].words, each entry with
word/start/end/confidence) is populated only on the final
frame (is_final: true); interim frames carry an empty words array. The
UtteranceEnd marker also reports last_word_end. When the client stops
sending audio, the connection closes cleanly with WebSocket close code
1000.
Supported source languages
Pass any of the codes below as thelanguage query parameter, or omit it
to default to en-us. You can also pass the Languages enum name
(EN_US) or its numeric ID. The model performs automatic language
detection regardless of the value passed.
All 143 supported source languages
All 143 supported source languages
| Code | Language |
|---|---|
en-us | English (United States) |
af-za | Afrikaans (South Africa) |
am-et | Amharic (Ethiopia) |
ar-ae | Arabic (United Arab Emirates) |
ar-bh | Arabic (Bahrain) |
ar-dz | Arabic (Algeria) |
ar-eg | Arabic (Egypt) |
ar-iq | Arabic (Iraq) |
ar-jo | Arabic (Jordan) |
ar-kw | Arabic (Kuwait) |
ar-lb | Arabic (Lebanon) |
ar-ly | Arabic (Libya) |
ar-ma | Arabic (Morocco) |
ar-om | Arabic (Oman) |
ar-qa | Arabic (Qatar) |
ar-sa | Arabic (Saudi Arabia) |
ar-sy | Arabic (Syria) |
ar-tn | Arabic (Tunisia) |
ar-ye | Arabic (Yemen) |
az-az | Azerbaijani (Latin, Azerbaijan) |
bg-bg | Bulgarian (Bulgaria) |
bn-bd | Bangla (Bangladesh) |
bn-in | Bengali (India) |
bs-ba | Bosnian (Bosnia And Herzegovina) |
ca-es | Catalan |
cs-cz | Czech (Czechia) |
cy-gb | Welsh (United Kingdom) |
da-dk | Danish (Denmark) |
de-at | German (Austria) |
de-ch | German (Switzerland) |
de-de | German (Germany) |
el-gr | Greek (Greece) |
en-au | English (Australia) |
en-ca | English (Canada) |
en-gb | English (United Kingdom) |
en-hk | English (Hong Kong Sar) |
en-ie | English (Ireland) |
en-in | English (India) |
en-ke | English (Kenya) |
en-ng | English (Nigeria) |
en-nz | English (New Zealand) |
en-ph | English (Philippines) |
en-sg | English (Singapore) |
en-tz | English (Tanzania) |
en-za | English (South Africa) |
es-ar | Spanish (Argentina) |
es-bo | Spanish (Bolivia) |
es-cl | Spanish (Chile) |
es-co | Spanish (Colombia) |
es-cr | Spanish (Costa Rica) |
es-cu | Spanish (Cuba) |
es-do | Spanish (Dominican Republic) |
es-ec | Spanish (Ecuador) |
es-es | Spanish (Spain) |
es-gq | Spanish (Equatorial Guinea) |
es-gt | Spanish (Guatemala) |
es-hn | Spanish (Honduras) |
es-mx | Spanish (Mexico) |
es-ni | Spanish (Nicaragua) |
es-pa | Spanish (Panama) |
es-pe | Spanish (Peru) |
es-pr | Spanish (Puerto Rico) |
es-py | Spanish (Paraguay) |
es-sv | Spanish (El Salvador) |
es-us | Spanish (United States) |
es-uy | Spanish (Uruguay) |
es-ve | Spanish (Venezuela) |
et-ee | Estonian (Estonia) |
eu-es | Basque |
fa-ir | Persian (Iran) |
fi-fi | Finnish (Finland) |
fr-be | French (Belgium) |
fr-ca | French (Canada) |
fr-ch | French (Switzerland) |
fr-fr | French (France) |
gl-es | Galician |
gu-in | Gujarati (India) |
he-il | Hebrew (Israel) |
hi-in | Hindi (India) |
hr-hr | Croatian (Croatia) |
hu-hu | Hungarian (Hungary) |
hy-am | Armenian (Armenia) |
id-id | Indonesian (Indonesia) |
is-is | Icelandic (Iceland) |
it-it | Italian (Italy) |
ja-jp | Japanese (Japan) |
ka-ge | Georgian (Georgia) |
kk-kz | Kazakh (Kazakhstan) |
km-kh | Khmer (Cambodia) |
kn-in | Kannada (India) |
ko-kr | Korean (Korea) |
lo-la | Lao (Laos) |
lt-lt | Lithuanian (Lithuania) |
lv-lv | Latvian (Latvia) |
mk-mk | Macedonian (North Macedonia) |
ml-in | Malayalam (India) |
mn-mn | Mongolian (Mongolia) |
mr-in | Marathi (India) |
ms-my | Malay (Malaysia) |
mt-mt | Maltese (Malta) |
my-mm | Burmese (Myanmar) |
nb-no | Norwegian (Bokmål, Norway) |
ne-np | Nepali (Nepal) |
nl-be | Dutch (Belgium) |
nl-nl | Dutch (Netherlands) |
pa-in | Punjabi (India) |
pl-pl | Polish (Poland) |
ps-af | Pashto (Afghanistan) |
pt-br | Portuguese (Brazil) |
pt-pt | Portuguese (Portugal) |
ro-ro | Romanian (Romania) |
ru-ru | Russian (Russia) |
si-lk | Sinhala (Sri Lanka) |
sk-sk | Slovak (Slovakia) |
sl-si | Slovenian (Slovenia) |
so-so | Somali (Somalia) |
sq-al | Albanian (Albania) |
sr-rs | Serbian (Cyrillic, Serbia) |
su-id | Sundanese (Indonesia) |
sv-se | Swedish (Sweden) |
sw-ke | Swahili (Kenya) |
sw-tz | Swahili (Tanzania) |
ta-in | Tamil (India) |
ta-lk | Tamil (Sri Lanka) |
ta-my | Tamil (Malaysia) |
ta-sg | Tamil (Singapore) |
te-in | Telugu (India) |
th-th | Thai (Thailand) |
tl-ph | Tagalog (Philippines) |
tr-tr | Turkish (Turkey) |
uk-ua | Ukrainian (Ukraine) |
ur-in | Urdu (India) |
ur-pk | Urdu (Pakistan) |
uz-uz | Uzbek (Latin, Uzbekistan) |
vi-vn | Vietnamese (Vietnam) |
zh-cn | Chinese (Mandarin, Simplified) |
zh-cn-henan | Chinese (Zhongyuan Mandarin Henan, Simplified) |
zh-cn-liaoning | Chinese (Northeastern Mandarin, Simplified) |
zh-cn-shaanxi | Chinese (Zhongyuan Mandarin Shaanxi, Simplified) |
zh-cn-shandong | Chinese (Jilu Mandarin, Simplified) |
zh-cn-sichuan | Chinese (Southwestern Mandarin, Simplified) |
zh-hk | Chinese (Cantonese, Traditional) |
zh-tw | Chinese (Taiwanese Mandarin, Traditional) |
Sample Testing Script
The CAMB SDKs wrap the protocol below behind a typed event dispatcher. The snippets here stream a WAV file at real-time pace so the server sees arrival patterns equivalent to a live microphone capture. For mic input, swapFileAudioSource(...) for Microphone(...) (Python) or
Microphone.fromBrowser / Microphone.fromNode (TypeScript) — see the
Live Transcription tutorial.
Raw protocol (no SDK)
If you cannot use the SDKs, the wire protocol is small enough to drive directly. Openwss://client.camb.ai/apis/transcription/listen?... with
the x-api-key header, send binary PCM frames matching the
encoding / sample_rate / channels query string, optionally send
{"type":"KeepAlive"} during silence, and finish with
{"type":"CloseStream"}. The server returns {"type":"Ready"} once,
then {"type":"Results", ...} frames carrying the cumulative transcript
("is_final": false for interim refinements, true on the frame that
finalizes each utterance), and closes with WebSocket code 1000 on a
clean shutdown.Messages
Previous
Live TTS (WebSocket)Stream text in, receive synthesized speech audio + optional word-level timestamps in real time over a single WebSocket connection.
Next
Messages