Get data from pending or completed transcriptions
Transcribe live speech from a microphone or live stream
Monitor and manage transcription state with sessions
Translate transcribed text to another language
Transcribe speech from pre-recorded audio in a URL to plain text
Create a temporary authentication token for client side requests
Create a session that can be used to broadcast a live transcription via a public shareable link
language
: The ISO 639-1 language code for the speech. duration_s
: The duration, in seconds, of the audio file. max_duration_s
: The maximum duration that can be transcribed, in seconds.0
if you would like to process the entire transcription, regardless of its duration (⚠️ use with caution). By default, this option is set to 7200
, ensuring that only the first two hours of the speech are transcribed.onData
event handler which provides the response
object.response
object has the following properties:status
: One of "waiting", "processing", "done" or "error"data.progress
: A value between 0 and 1 signifying the transcription progress percentagedata.timeline
: If the status is "processing" or "done" the timeline object will be available, showing the entire transcription available up until that point. The timeline is an array of objects containing these properties:start
: the start time of the transcription segmentend
: the end time of the transcription segmenttext
: the chunk of text in the transcription segmenttranslations
: a key-value store of language codes in ISO 639-1 and translations (this property is only available if the transcription has at least one translation)response
will be sent to onData
. In the final response, the status of the transcription will be "done", and these new properties will be included in data
:keywords
: a few key words representing topics from the transcriptionsummary
: a single paragraph summary of the entire transcriptionparagraphs
: the entire transcription grouped into paragraphs, segmented by themes, or by a meaningful transition to a new topicresponse
object has the UrlTranscriptionResponse
type. TypeScriptimport { UrlTranscription, UrlTranscriptionResponse } from '@vocalstack/js-sdk'; const sdk = new UrlTranscription({ apiKey: 'YOUR-API-KEY' }); const transcription = await sdk.start({ url: 'http://example.com/audio.mp3' }); transcription.onData((response: UrlTranscriptionResponse) => { console.log(response.data); });