Live transcription
You can receive speech as ILiveTranscriptionMessageInfo 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 ZoomVideoSDK.getInstance().getLiveTranscriptionHelper() to get the live transcription helper.
val lttHelper = ZoomVideoSDK.getInstance().liveTranscriptionHelper
ZoomVideoSDKLiveTranscriptionHelper lttHelper = ZoomVideoSDK.getInstance().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
lttHelper.availableSpokenLanguages.forEach {
Log.d(TAG, "Spoken language ID: ${it.lttLanguageID}")
Log.d(TAG, "Spoken language name: ${it.lttLanguageName}")
}
// iterate and print out language ID and language name of supported spoken languages
List<ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionLanguage> availableSpokenLanguages = lttHelper.getAvailableSpokenLanguages();
if (availableSpokenLanguages != null) {
for (int i = 0; i < availableSpokenLanguages.size(); ++i) {
ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionLanguage language = availableSpokenLanguages.get(i);
if (language != null) {
Log.d(TAG, "Spoken language ID: "+ language.getLTTLanguageID());
Log.d(TAG, "Spoken language name: " + language.getLTTLanguageName());
}
}
}
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).
lttHelper.setSpokenLanguage(0)
lttHelper.setSpokenLanguage(0);
Start transcription
To start live transcription, call startLiveTranscription().
if (lttHelper.canStartLiveTranscription()) {
lttHelper.startLiveTranscription()
}
if (lttHelper.canStartLiveTranscription()) {
lttHelper.startLiveTranscription();
}
Receive transcription
To receive speech text, you must first inherit the ZoomVideoSDKDelegate interface in your calling class and explicitly enable the reception of spoken language content.
class MainActivity : AppCompatActivity, ZoomVideoSDKDelegate
// Enable the reception of transcription/translation content
lttHelper.enableReceiveSpokenLanguageContent(true)
public class MainActivity extends AppCompatActivity implements ZoomVideoSDKDelegate
// Enable the reception of transcription/translation content
lttHelper.enableReceiveSpokenLanguageContent(true);
Add this (MainActivity) to your ZoomVideoSDK event listener.
ZoomVideoSDK.getInstance().addListener(this)
ZoomVideoSDK.getInstance().addListener(this);
The SDK invokes the following methods when it fires transcription-related events.
override fun onLiveTranscriptionStatus(status: ZoomVideoSDKLiveTranscriptionHelper.ZoomVideoSDKLiveTranscriptionStatus) { }
override fun onLiveTranscriptionMsgInfoReceived(messageInfo: ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionMessageInfo) { }
@Override
public void onLiveTranscriptionStatus(ZoomVideoSDKLiveTranscriptionHelper.ZoomVideoSDKLiveTranscriptionStatus status) { }
@Override
public void onLiveTranscriptionMsgInfoReceived(ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionMessageInfo messageInfo) { }
To receive live transcription text, handle the events fired within onLiveTranscriptionMsgInfoReceived. In the following code sample, getMessageType() retrieves an enum to indicate the type of message that getMessageContent() returns.
override fun onLiveTranscriptionMsgInfoReceived(messageInfo: ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionMessageInfo) {
Log,d(TAG, "Message info content is: ${messageInfo.messageContent}")
Log.d(TAG, "Message info type is: ${messageInfo.messageType}")
}
@Override
public void onLiveTranscriptionMsgInfoReceived(ZoomVideoSDKLiveTranscriptionHelper.ILiveTranscriptionMessageInfo messageInfo) {
Log.d(TAG, "Message info content is: " + messageInfo.getMessageContent());
Log.d(TAG, "Message info type is: " + messageInfo.getMessageType());
}
getMessageType() returns the transcription operation type, such as whether the message was added or the operation was completed. For more information, see the Enum Reference.
Stop transcription
To stop live transcription, call stopLiveTranscription().
lttHelper.stopLiveTranscription()
lttHelper.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 Interface ZoomVideoSDKLiveTranscriptionHelper in the Zoom SDK for Android.