Skip to main content
Available since v5.0.5 — transcription and closed captions require CometChat Calls SDK v5.0.5 or later for JavaScript. See Setup to install or upgrade.
Transcribe call sessions in real time and display live closed captions on screen. Transcripts are stored server-side and can be retrieved after the call using TranscriptRequestBuilder.
Transcription must be enabled for your CometChat app. Contact support if you need to enable this feature.

How It Works

Transcription and closed captions are two related but separate things: Starting transcription is a prerequisite for captions — toggling captions on without an active transcription shows nothing.

Starting Transcription

Auto-Start Transcription

Configure transcription to start automatically when the session begins:
Default: false

Manual Transcription Control

Start Transcription

Begin transcribing during an active call:

Stop Transcription

Stop the current transcription. Any captions currently on screen are cleared:

Built-in UI Controls

Transcription Button

By default, the transcription button in the control panel’s More menu is hidden. To show it:
Default: true The menu item toggles between Start Transcription and Stop Transcription based on the current state.

Closed Caption Button

By default, the closed-caption (CC) button in the control panel is hidden. To show it:
Default: true
Even with hideClosedCaptionButton: false, the CC button only appears once transcription is running for the session, because captions are generated from the live transcript.

Closed Caption Settings

When the CC button is visible, the settings dialog gains a Closed Caption tab where the user can pick the caption language and enable or disable the on-screen captions. The gear icon on the captions overlay opens the dialog directly on that tab.

Caption Language

Property: captionLanguage Sets the language used for transcription and captions.
Default: en-US

Retrieving Transcripts

After a call, use TranscriptRequestBuilder to list the transcript artifacts for a session. Each record is a pointer to a downloadable transcript file, not the transcript text itself.
The SDK must be initialized with CometChatCalls.init() and a user must be logged in. The auth token is read from the logged-in user at fetch time, so it automatically tracks re-logins.

Building a Request

Paginating

A TranscriptRequest is a stateful cursor. Create one per session ID and drive it with fetchNext() and fetchPrevious():
  • fetchNext() resolves the next page, or [] when there are no more pages. A session with no transcripts resolves [].
  • fetchPrevious() resolves the previous page, or [] when already on the first page. It never requests a page below 1.
  • Only one fetch may be in flight at a time. Calling fetchNext() or fetchPrevious() while another request is pending rejects with REQUEST_IN_PROGRESS; the original call is unaffected and still completes.

Transcript Properties

Every property is optional. The server omits keys whose value is empty, so sparse records are normal and should not be treated as an error.

Reading the Transcript Content

transcriptUrl points at the transcript file. Fetch it yourself to read the actual utterances:

Error Handling

build() throws synchronously; fetchNext() and fetchPrevious() reject. Both surface a CometChatCallsException carrying a code:

Transcripts in Call Logs

Call logs can be filtered to transcribed calls, which also attaches each call’s transcripts to the log:
getTranscriptions() returns an empty array when the server omitted transcripts, so it never needs a null check.

Complete Example