Live Transcription for Conferencing (Closed Captions - Beta)
100ms real-time transcription engine generates a live transcript (closed captions) during a conferencing session. The SDK provides a callback with transcript for each peer when they speak.
Minimum Requirements
- Minimum 100ms SDK version required is 0.10.8
How to implement closed captioning?
You implement useTranscript
hook with onTranscript
callback like below:
export interface HMSTranscript { // start time in second start: number; // end time in seconds end: number; // peer_id of the speaker peer_id: string; // transcription will continue update the transcript until you receive final keyword final: boolean; // transcripted caption transcript: string; } export interface useHMSTranscriptInput { onTranscript?: (data: HMSTranscript[]) => void; handleError?: hooksErrHandler; } export const useTranscript = ({ onTranscript, handleError = logErrorHandler }: useHMSTranscriptInput); }
How to know if transcript is enabled in a room
import { selectIsTranscriptionEnabled, useHMSStore } from '@100mslive/react-sdk'; // use this to check if caption is enabled for your room. const isCaptionPresent: boolean = useHMSStore(selectIsTranscriptionEnabled);
Have a suggestion? Recommend changes ->