Captions interface

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Extends

Inherited Properties

activeSpokenLanguage

Indicates the current active spoken language in the call in BCP 47 format

isCaptionsFeatureActive

Indicates if captions are active in the current call

kind

Indicates the Captions type for the active captions object

supportedSpokenLanguages

List of supported spoken languages to use with the caption service in BCP 47 format

Methods

off(CaptionsPropertyChangedEventType, PropertyChangedEvent)

Unsubscribe function for any of the CaptionsPropertyChangedEventType events

off(CaptionsReceivedEventType, CaptionsHandler)

Unsubscribe function for any of the CaptionsPropertyChangedEventType events

off(SpokenLanguageChangedEventType, PropertyChangedEvent)

Unsubscribe function for any of the SpokenLanguageChangedEventType events

on(CaptionsPropertyChangedEventType, PropertyChangedEvent)

Subscribe function for any of the CaptionsPropertyChangedEventType events

on(CaptionsReceivedEventType, CaptionsHandler)

Subscribe function for the CaptionsReceivedEventType event

on(SpokenLanguageChangedEventType, PropertyChangedEvent)

Subscribe function for any of the SpokenLanguageChangedEventType events

Inherited Methods

setSpokenLanguage(string)

Updates the language of the ongoing Transcription / Captions

startCaptions(StartCaptionsOptions)

Starts the processing of captions in this call with the provided handler for this client.

stopCaptions()

Stops the retrieval of captions data in the call for the user who initiated stopCaptions.

Inherited Property Details

activeSpokenLanguage

Indicates the current active spoken language in the call in BCP 47 format

activeSpokenLanguage: string

Property Value

string

Inherited From CaptionsCommon.activeSpokenLanguage

isCaptionsFeatureActive

Indicates if captions are active in the current call

isCaptionsFeatureActive: boolean

Property Value

boolean

Inherited From CaptionsCommon.isCaptionsFeatureActive

kind

Indicates the Captions type for the active captions object

kind: CaptionsKind

Property Value

Inherited From CaptionsCommon.kind

supportedSpokenLanguages

List of supported spoken languages to use with the caption service in BCP 47 format

supportedSpokenLanguages: string[]

Property Value

string[]

Inherited From CaptionsCommon.supportedSpokenLanguages

Method Details

off(CaptionsPropertyChangedEventType, PropertyChangedEvent)

Unsubscribe function for any of the CaptionsPropertyChangedEventType events

function off(event: CaptionsPropertyChangedEventType, listener: PropertyChangedEvent)

Parameters

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event

off(CaptionsReceivedEventType, CaptionsHandler)

Unsubscribe function for any of the CaptionsPropertyChangedEventType events

function off(event: CaptionsReceivedEventType, listener: CaptionsHandler)

Parameters

event
CaptionsReceivedEventType

event name

listener
CaptionsHandler

callback fn that was used to subscribe to this event

off(SpokenLanguageChangedEventType, PropertyChangedEvent)

Unsubscribe function for any of the SpokenLanguageChangedEventType events

function off(event: SpokenLanguageChangedEventType, listener: PropertyChangedEvent)

Parameters

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event

on(CaptionsPropertyChangedEventType, PropertyChangedEvent)

Subscribe function for any of the CaptionsPropertyChangedEventType events

function on(event: CaptionsPropertyChangedEventType, listener: PropertyChangedEvent)

Parameters

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event

on(CaptionsReceivedEventType, CaptionsHandler)

Subscribe function for the CaptionsReceivedEventType event

function on(event: CaptionsReceivedEventType, listener: CaptionsHandler)

Parameters

event
CaptionsReceivedEventType

event name

listener
CaptionsHandler

callback fn that was used to subscribe to this event

on(SpokenLanguageChangedEventType, PropertyChangedEvent)

Subscribe function for any of the SpokenLanguageChangedEventType events

function on(event: SpokenLanguageChangedEventType, listener: PropertyChangedEvent)

Parameters

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event

Inherited Method Details

setSpokenLanguage(string)

Updates the language of the ongoing Transcription / Captions

function setSpokenLanguage(language: string): Promise<void>

Parameters

language

string

The language to caption speech as. Must be BCP 47 format (e.g. "en-us")

Returns

Promise<void>

A Promise representing the completion of the Set Language operation. The completion of this promise does NOT indicate the language has changed. A 'SpokenLanguageChanged' event will be emitted when the language has actually successfully changed.

Inherited From CaptionsCommon.setSpokenLanguage

startCaptions(StartCaptionsOptions)

Starts the processing of captions in this call with the provided handler for this client.

function startCaptions(startCaptionsOptions?: StartCaptionsOptions): Promise<void>

Parameters

startCaptionsOptions
StartCaptionsOptions

Additional options for starting captions.

Returns

Promise<void>

A Promise representing the completion of the intialization process for the Start Caption operation The completion of this promise does NOT indicate the captions have started. A 'CaptionsActiveChanged' event will be emitted when captions have actually successfully started.

Inherited From CaptionsCommon.startCaptions

stopCaptions()

Stops the retrieval of captions data in the call for the user who initiated stopCaptions.

function stopCaptions(): Promise<void>

Returns

Promise<void>

A promise representing the completion of the Stop Caption operation The completion of this promise does NOT indicate the captions bot has left the call. The participant will unsubscribe from receiving captions data upon successfully stopped.

Inherited From CaptionsCommon.stopCaptions