Real-time time transcription results will generally be delivered over a websocket. although polling is also supported.
There are 3 types of websockets for transcription results:
- transceiver - the results are sent back via the websocket that is used to stream the audio.
- adHoc - a websocket url with random name is used. There can be only one consumer that can connect to the websocket. There are two reasons to use the adHoc websocket rather than the transceiver:
- the receiver can be in a different location than the audio sender
- it supports STOMP protocol - which is more robust as is supports reconnects, but it has additional overhead
- predefined - the results are sent back via a separate predefined websocket. This is the default websocket mode (for historical reasons). Websocket needs to be predefined via Voicegain Portal or using /websocket API. Predefined websockets will generally be used with STOMP protocol for broadcasting transcripts.
Here is a documentation about what the payload of the websocket looks like:
- Websocket payload for real-time transcription results
- This is the API Spec - requires login into https://console.voicegain.ai
Uses cases for STOMP and predefined websockets
Here are some relevant articles:
- Example of streaming audio via websocket and broadcasting transcript via websocket - this shows predefined named websocket and use of STOMP (example is in Java)
- Live Transcription Overview - this shows how to use the CC-App tool to receive the transcript over websocket
Other websocket examples
- Example of streaming audio via websocket and receiving text via websocket - this uses adHoc websocket and no STOMP (example is in Java)
- Example of streaming audio via RTP and receiving result via websocket - this is a python example and it uses ffmpeg to stream using RTP. Uses adHoc and no STOMP
- platform/async-real-time-websocket-in-and-out.py at master · voicegain/platform · GitHub - an example in python
We have also other examples, including transceiver websocket mode, on our Gitlab. Please contact support@voicegain.ai to gain access to these.
Comments
0 comments
Please sign in to leave a comment.