Skip to main content
Available since v5.0.4 — transcription and closed captions require CometChat Calls SDK v5.0.4 or later for iOS. 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 TranscriptsRequest.
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 — turning 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

Both transcription controls live in the control panel’s More menu, and both are hidden by default.

Transcription Menu Item

To show the transcription item:
Default: true The item toggles between Start Transcription and Stop Transcription based on the current state.

Closed Caption Menu Item

To show the closed-caption item:
Default: true The item toggles between Show Captions and Hide Captions.
Captions are off by default, so the overlay appears only after the user turns them on and transcription is running for the session. Turning captions on before transcription starts shows nothing until the transcript begins arriving.

Caption Language

Method: setCaptionLanguage(_ captionLanguage: String) Sets the language used for transcription and captions.
Default: en-US

Retrieving Transcripts

After a call, use TranscriptsRequest 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 — there is no set(authToken:) on this builder.

Building a Request

Callbacks are delivered on the main queue, so it is safe to update UI directly from them.

Paginating

A TranscriptsRequest is a stateful cursor. Create one per session ID and drive it with fetchNext and fetchPrevious:
  • fetchNext delivers the next page, or an empty array when there are no more pages. A session with no transcripts delivers an empty array.
  • fetchPrevious delivers the previous page, or an empty array when already on the first page. It never requests a page below 1.
  • The cursor is committed only from a successful response, so a failed fetch can simply be retried.
  • Only one fetch may be in flight per request instance. Calling fetchNext or fetchPrevious while another is pending fails with ERROR_REQUEST_IN_PROGRESS; the original call is unaffected and still completes.

Transcript Properties

The server omits keys whose value is empty, so sparse records are normal and should not be treated as an error. Missing string fields arrive as "" and missing numbers as 0. A single entry that fails to parse is skipped rather than failing the whole page.

Reading the Transcript Content

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

Error Handling

Failures are delivered to the onError closure as a CometChatCallException carrying an errorCode:

Transcripts in Call Logs

Call logs can be filtered to transcribed calls, which also attaches each call’s transcripts to the log:
transcriptions is an empty array when the server omitted transcripts, so it never needs a nil check. Passing false leaves the list unfiltered, exactly as if the filter had never been set — and the server then omits the transcripts.

Complete Example