Live Transcripts
Live transcripts are auto-generated and available in real time. Inaccuracies may occur.
Quartr API includes live transcribed transcripts during live calls. These transcripts are automatically generated, providing a textual representation of the audio content in real-time.
Understanding the Live Transcript File
An example stream can be found here.
This file is initiated as soon as the live audio begins, although there might be a delay before the first spoken words are transcribed. Each line of the JSONL file represents a segment of the transcript, detailing the text spoken, its start and end times, and a unique paragraph identifier. The timestamps in the liveTranscriptJsonUrl match the audio of the live audio stream found in the liveUrl in the liveState of an event.
For instance:
{"s":581.4,"e":581.64,"p":"18","t":"that","S":"0"}
{"s":582.84,"e":583.34,"p":"18","t":"considered","S":"0"}
Explanation of the JSONL Format
The live transcript is a JSON Lines (.jsonl) file, where each new line is a JSON object containing a fragment of the transcript. These fragments come with various attributes, such as start (s) and end (e) times, transcript text (t), and a paragraph identifier (p) as well as a speaker identifier (S). Additionally, some fragments may include an optional text (ot) field, which provides a substitute for indiscernible words. Words with low confidence are marked with [Indiscernible], and in some applications, these may not be displayed at all.
How to Use the Live Transcript
To effectively use the live transcript, clients should poll the .jsonl file periodically—every 1-4 seconds is recommended—to retrieve updates without reloading the entire file, which would be inefficient. This can be accomplished by using the Range header in the HTTP request, setting the range to start from the byte after the last received content. This method ensures that only new data is fetched, keeping the process lightweight. Once the type:end line appears in the transcript, polling can cease, indicating the live event's conclusion.
For the technical implementation of range requests, refer to the Mozilla documentation on single-part range requests, which provides detailed guidance on the process and/or see the following example.
Code Example
In the next section, you will find a code example demonstrating how to continuously stream an ongoing live transcript file, ensuring your live transcripts are up-to-date and accurately synchronized with the corresponding audio streams. See repository for a full example.
function startStreaming(liveJsonTranscriptUrl) {
let range = 0;
const interval = 2000
const refetchStream = setInterval(() => {
// test loop: https://ds.quartr.com/loop/live_transcript.jsonl
axios({
method: "get",
url: liveJsonTranscriptUrl,
responseType: "stream",
headers: {
"Content-Type": "application/json",
range: `bytes=${range}-`,
}
}).then(function (response) {
const rangeHeader = response.headers["content-range"];
range = rangeHeader.split("/")[0].split("-")[1];
const lineReader = readline.createInterface({
input: response.data,
crlfDelay: Infinity
});
lineReader.on("line", (line) => {
const record = JSON.parse(line);
handleRecord(record);
});
}).catch(function (error) {
console.error("Error streaming transcript:", error);
clearInterval(refetchStream)
});
}, interval)
}