Realtime Transcription - iOS
Realtime transcription allows you to transcribe audio content into text in real-time during a session. This guide will walk you through using the startTranscription() and stopTranscription() functions to manage realtime transcription in your application.
You can also set up webhooks for realtime transcription.
Please ensure eligibility prior to enabling realtime transcription. For further details, please contact us.
Integrating Realtime Transcription Feature

The image above shows these steps:
-
Start Transcription: The SDK Client initiates real-time transcription using the
startTranscriptionmethod. -
Server Response: VideoSDK starts transcription for the room, or refuses the request.
- If the request is denied,
startTranscription()throws aVideoSDKError, such asSTART_TRANSCRIPTION_FAILED(4031). - If the request is successful, the client receives the
onTranscriptionStateChangedevent withTRANSCRIPTION_STARTED, indicating that transcription has begun.
- If the request is denied,
-
Transcription Data: As transcription progresses, the client receives the
onTranscriptionTextevent with data such as the text itself, the speaker's participant ID and name, and timestamp. Itstypeis.REALTIMEfor a partial result that can still change,.FULL_SENTENCEfor the settled sentence, ornil. -
Stop Transcription: The client stops transcription with the
stopTranscription()method.- The client then receives the
onTranscriptionStateChangedevent withTRANSCRIPTION_STOPPEDto confirm that transcription has ended.
- The client then receives the
Step 1: Configure Realtime Transcription
- In this step, we set up the configuration for realtime transcription. We define the webhook URL where the webhooks will be received.
TranscriptionConfig(webhookURL:summary:modelConfig:)takes only optional fields.modelConfigmust be JSON-serializable, orstartTranscription()throwsERROR_INVALID_PARAMETER.
- Swift
// Realtime Transcription Configuration
let config = TranscriptionConfig(
webhookURL: "YOUR_WEBHOOK_URL",
summary: SummaryConfig(
enabled: true,
prompt: "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
)
)
Step 2: Start realtime transcription
- Initiate the realtime transcription using the
startTranscription()method. startTranscription()isasync throws. Call it withtry awaitinside aTask, after you join the room.
- Swift
// Starts realtime transcription
@IBAction func startTranscriptionTapped(_ sender: Any) {
let config = TranscriptionConfig(
webhookURL: "YOUR_WEBHOOK_URL",
summary: SummaryConfig(
enabled: true,
prompt: "Write summary in sections like Title, Agenda, Speakers, Action Items, Outlines, Notes and Summary"
)
)
Task {
do {
try await room?.startTranscription(config: config)
} catch {
print("Failed to start transcription: \(error)")
}
}
}
Step 3: Stop realtime transcription
- Terminate the realtime transcription using the
stopTranscription()method. It is alsoasync throws.
- Swift
// Stops realtime transcription
@IBAction func stopTranscriptionTapped(_ sender: Any) {
Task {
do {
try await room?.stopTranscription()
} catch {
print("Failed to stop transcription: \(error)")
}
}
}
Step 4: Listen for transcription events
- Here, we configure the callback methods for transcription events.
- Swift
import VideoSDKRTC
extension RoomViewController: RoomEventListener {
// Listen for transcription state changed event
func onTranscriptionStateChanged(state: TranscriptionState) {
switch state {
case .TRANSCRIPTION_STARTING:
print("transcription starting")
case .TRANSCRIPTION_STARTED:
print("transcription started")
case .TRANSCRIPTION_STOPPING:
print("transcription stopping")
case .TRANSCRIPTION_STOPPED:
print("transcription stopped")
@unknown default:
break
}
}
// Listen for transcription text event
func onTranscriptionText(_ data: TranscriptionText) {
print("transcription text: ", data.text)
print("participant name", data.participantName)
}
}
To show the text in each participant's own language, use real-time translation. Each participant sets a language with the translationLanguage parameter of createRoom() or with changeTranslationLanguage(_:). After you call startTranslation(), each participant receives the translated text through onTranslationText(_:). See Realtime Translation for a step-by-step guide.
API Reference
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord

