Live transcription

You can receive speech as ZMVideoSDKLiveTranscriptionMessageInfo objects, in real time, using the Zoom live transcription and translation feature (LTT).

Zoom recommends that you provide an in-product notice to your end-users when a participant enables live transcription.

Initialize LTT

After joining a session, call ZMVideoSDK.sharedVideoSDK()?.getLiveTranscriptionHelper() to get the live transcription helper.

let liveTranscriptionHelper = ZMVideoSDK.sharesharedVideoSDKInstance()?.getLiveTranscriptionHelper()
ZMVideoSDKLiveTranscriptionHelper *liveTranscriptionHelper = [[ZMVideoSDK sharedVideoSDK] getLiveTranscriptionHelper];

Supported languages

We are continuously adding to our supported languages for transcription. The following code samples demonstrate how you can check on the list of supported spoken languages.

List supported spoken languages

// Iterate and print out language ID and language name of supported spoken languages
if let availableSpokenLanguages = liveTranscriptionHelper.getAvailableSpokenLanguages() {
    for language in availableSpokenLanguages {
        print("Spoken Language ID: \(language.languageID)")
        print("Spoken Language Name: \(language.languageName)")
    }
}
// Iterate and print out the language ID and language name of supported spoken languages
NSArray<ZMVideoSDKLiveTranscriptionLanguage *> *availableSpokenLanguages = [liveTranscriptionHelper getAvailableSpokenLanguages];
if (availableSpokenLanguages != nil) {
    for (ZMVideoSDKLiveTranscriptionLanguage* language in availableSpokenLanguages) {
        NSLog(@"Spoken Language ID: %ld", (long)[language languageID]);
        NSLog(@"Spoken Language Name: %@", [language languageName]);
    }
}

Set spoken language

Typically, you might set the spoken language using setSpokenLanguage(language_id) before starting live transcription. If you do not set it, the spoken language defaults to "English" (0).

liveTranscriptionHelper.setSpokenLanguage(0)
[liveTranscriptionHelper setSpokenLanguage: 0];

Start transcription

To start live transcription, call startLiveTranscription().

liveTranscriptionHelper.startLiveTranscription()
[liveTranscriptionHelper startLiveTranscription];

Receive transcription

To receive speech text, you must first inherit the ZMVideoSDKDelegate property in your calling class and assign the delegate to the same class.

ZoomVideoSDK.shareInstance()?.addListener(self)
extension MainViewController: ZMVideoSDKDelegate {
}
@interface MainViewController () <ZMVideoSDKDelegate>
[[ZMVideoSDK sharedVideoSDK] addListener:self];

The SDK invokes the following methods when it fires transcription-related events.

extension MainViewController: ZMVideoSDKDelegate {
    func onLiveTranscriptionMsgReceived(_ messageInfo: ZMVideoSDKLiveTranscriptionMessageInfo!) {
    }
    func onLiveTranscriptionStatus(_ status: ZMVideoSDKLiveTranscriptionStatus) {
    }
    func onLiveTranscriptionMsgError(_ spokenLanguage: ZMVideoSDKLiveTranscriptionLanguage!, transcriptLanguage transcriptLanguage: ZMVideoSDKLiveTranscriptionLanguage!) {
    }
}
- (void)onLiveTranscriptionMsgInfoReceived:(ZMVideoSDKLiveTranscriptionMessageInfo *)messageInfo {
    }
- (void)onLiveTranscriptionStatus:(ZMVideoSDKLiveTranscriptionStatus)status {
    }
- (void)onLiveTranscriptionMsgError:(ZMVideoSDKLiveTranscriptionLanguage *)spokenLanguage transcriptLanguage:(ZMVideoSDKLiveTranscriptionLanguage *)transcriptLanguage {
    }

To receive live transcription text, handle the events fired within onLiveTranscriptionMsgReceived. In the following code sample, messageType retrieves an enum to indicate the type of message that messageContent returns.

func onLiveTranscriptionMsgReceived(_ messageInfo: ZMVideoSDKLiveTranscriptionMessageInfo!) {
    print("MessageInfoContent is :\(messageInfo.messageContent)")
    print("MessageInfoType is :\(messageInfo.messageType)")
}
- (void)onLiveTranscriptionMsgReceived:(ZMVideoSDKLiveTranscriptionMessageInfo *)messageInfo {
    NSLog(@"MessageInfoContent is : %@", [messageInfo messageContent]);
    NSLog(@"MessageInfoType is : %u", [messageInfo messageType]);
}

messageType returns the transcription operation type, such as whether the message was added or the operation was completed. For more information, see Transcription operation type enums.

Stop transcription

To stop live transcription, call stopLiveTranscription().

liveTranscriptionHelper.stopLiveTranscription()
[liveTranscriptionHelper stopLiveTranscription];

LTT best practices

When implementing Live Transcription and Translation (LTT) for your integration, consider the following best practices:

  • If the feature is enabled for the session, provide a button to allow people to start closed captioning and select the spoken and translated languages.
  • Display only the supported languages you wish to offer, rather than presenting all available options for transcription and translation.
  • If the session won't include LTT, programmatically disable when the host starts the session. When someone joins the session, check if the feature is enabled by the host. If not, inform users.
  • Use an event listener to detect when the host has enabled captions. You can use this to notify people that the feature is active, programmatically render a button for starting transcription or translation, or both.
  • Set enableReceiveSpokenLanguageContent() to false if you don't want to receive the spoken language data.
  • Use an event listener to detect when the host disables captions. You can use this to notify people who have enabled the feature that it has been disabled.
  • Offer closed captioning customization options, such as font sizes and colors, to differentiate between transcription and translation texts, to enhance readability and follow accessibility standards.
  • Inform people of these best practices when speaking:
    • Minimize background noise, avoiding activities like shuffling papers, typing loudly, or engaging in side conversations.
    • Speak clearly into the microphone.
    • Position the microphone near active speakers.
    • Opt for an external microphone over a built-in one to improve sound quality.

More LTT features

For the full set of live transcription features, see ZMVideoSDKLiveTranscriptionHelper in the Zoom SDK for macOS.