Stream Sound To Text
Live captions while someone speaks: partial text first, then final lines. Your server creates a session and a one-time ticket; your app connects with the ticket.
https://borminto.com/api/v1/voice/transcription-sessions
- Create a session
Send
language, such asar-EG. Keepsession_idfrom the 201 response. - Get a ticket
POST …/transcription-sessions/{session}/connectwithtransport:websocketorwebrtc. The ticket works once, for 45 seconds. - Connect and speak
Open
wss://borminto.com/voice-stream/transcription/socketwith the subprotocolsborminto.transcription.v1and the ticket, then send audio aftersession.ready. Add browser origins in Applications & API keys. - End
DELETE …/transcription-sessions/{session}/connection. Final lines stay readable for 24 hours withGET …/transcription-sessions/{session}.
Events
| Event | Meaning |
|---|---|
session.ready | Start sending audio. Usage starts here, including silence. |
transcript.partial | Text so far for a segment_id. Replace it as new ones arrive; ignore older sequence values. |
transcript.final | The finished line for that segment_id. |
session.ended | reason is finished, connection_ended or allowance_ended. |
session.error | code is invalid_audio, audio_backpressure, source_unavailable, source_disconnected, allowance_unavailable or transcript_delivery_failed. |
Errors
Continuing a stream
A ready connection uses the application's voice allowance while it is open. If the gateway reports usage_day_ended or source_limit, reconnect the same session using a fresh ticket. Retrieve any finalized segments with GET /api/v1/voice/transcription-sessions/{session}. If the allowance is exhausted, wait for the next reset or change the application's plan.
| Status | Code | What to do |
|---|---|---|
| 401 | authentication_required | Invalid key or ticket. Request a fresh ticket. |
| 402 | allowance_exhausted | The allowance has run out or expired. |
| 403 | request_failed | The browser origin is not allowed: add it in Applications & API keys. application_suspended means the application is suspended. |
| 404 | not_found | The session does not exist for this key. |
| 409 | turn_conflict | Another connection is open. Close it before connecting again. |
| 422 | invalid_request | Invalid language or transport. |
| 429 | rate_limited | Too many requests or connections. Wait for Retry-After. |
| 503 | voice_unavailable | Temporarily at capacity. Retry with a new ticket. |