ConversationTranslatorRecognizer class

Sends messages to the Conversation Translator websocket and listens for incoming events containing websocket messages. Based off the recognizers in the SDK folder.

Extends

Constructors

ConversationTranslatorRecognizer(SpeechTranslationConfig, AudioConfig)

Properties

canceled
connected
connectionClosed
connectionOpened
conversationExpiration
disconnected
internalData
lockRoomCommandReceived
muteAllCommandReceived
participantJoinCommandReceived
participantLeaveCommandReceived
participantsChanged
participantsListReceived
participantUpdateCommandReceived
properties

Return the properties for the recognizer

sessionStarted

Defines event handler for session started events.

sessionStopped

Defines event handler for session stopped events.

speechEndDetected

Defines event handler for speech stopped events.

speechRecognitionLanguage

Return the speech language used by the recognizer

speechStartDetected

Defines event handler for speech started events.

telemetryEnabled

This method returns the current state of the telemetry setting.

translationReceived

Methods

close()

Close and dispose the recognizer

connect(string, () => void, (e: string) => void)

Connect to the recognizer

disconnect(() => void, (e: string) => void)

Disconnect from the recognizer

enableTelemetry(boolean)

This method globally enables or disables telemetry.

isDisposed()
sendRequest(string, () => void, (e: string) => void)

Send the mute all participants command to the websocket

Constructor Details

ConversationTranslatorRecognizer(SpeechTranslationConfig, AudioConfig)

new ConversationTranslatorRecognizer(speechConfig: SpeechTranslationConfig, audioConfig?: AudioConfig)

Parameters

audioConfig
AudioConfig

Property Details

canceled

canceled: (sender: ConversationRecognizer, event: ConversationTranslationCanceledEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ConversationTranslationCanceledEventArgs) => void

connected

any connected

Property Value

any

connectionClosed

connectionClosed: (sender: ConversationRecognizer, event: SessionEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: SessionEventArgs) => void

connectionOpened

connectionOpened: (sender: ConversationRecognizer, event: SessionEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: SessionEventArgs) => void

conversationExpiration

conversationExpiration: (sender: ConversationRecognizer, event: ConversationExpirationEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ConversationExpirationEventArgs) => void

disconnected

any disconnected

Property Value

any

internalData

object internalData

Property Value

object

lockRoomCommandReceived

lockRoomCommandReceived: (sender: ConversationRecognizer, event: LockRoomEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: LockRoomEventArgs) => void

muteAllCommandReceived

muteAllCommandReceived: (sender: ConversationRecognizer, event: MuteAllEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: MuteAllEventArgs) => void

participantJoinCommandReceived

participantJoinCommandReceived: (sender: ConversationRecognizer, event: ParticipantEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ParticipantEventArgs) => void

participantLeaveCommandReceived

participantLeaveCommandReceived: (sender: ConversationRecognizer, event: ParticipantEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ParticipantEventArgs) => void

participantsChanged

participantsChanged: (sender: ConversationRecognizer, event: ConversationParticipantsChangedEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ConversationParticipantsChangedEventArgs) => void

participantsListReceived

participantsListReceived: (sender: ConversationRecognizer, event: ParticipantsListEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ParticipantsListEventArgs) => void

participantUpdateCommandReceived

participantUpdateCommandReceived: (sender: ConversationRecognizer, event: ParticipantAttributeEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ParticipantAttributeEventArgs) => void

properties

Return the properties for the recognizer

PropertyCollection properties

Property Value

sessionStarted

Defines event handler for session started events.

public sessionStarted: (sender: Recognizer, event: SessionEventArgs) => void

Property Value

(sender: Recognizer, event: SessionEventArgs) => void

sessionStopped

Defines event handler for session stopped events.

public sessionStopped: (sender: Recognizer, event: SessionEventArgs) => void

Property Value

(sender: Recognizer, event: SessionEventArgs) => void

speechEndDetected

Defines event handler for speech stopped events.

public speechEndDetected: (sender: Recognizer, event: RecognitionEventArgs) => void

Property Value

(sender: Recognizer, event: RecognitionEventArgs) => void

speechRecognitionLanguage

Return the speech language used by the recognizer

string speechRecognitionLanguage

Property Value

string

speechStartDetected

Defines event handler for speech started events.

public speechStartDetected: (sender: Recognizer, event: RecognitionEventArgs) => void

Property Value

(sender: Recognizer, event: RecognitionEventArgs) => void

telemetryEnabled

This method returns the current state of the telemetry setting.

static boolean telemetryEnabled

Property Value

boolean

true if the telemetry is enabled, false otherwise.

translationReceived

translationReceived: (sender: ConversationRecognizer, event: ConversationReceivedTranslationEventArgs) => void

Property Value

(sender: ConversationRecognizer, event: ConversationReceivedTranslationEventArgs) => void

Method Details

close()

Close and dispose the recognizer

function close()

Returns

Promise<void>

connect(string, () => void, (e: string) => void)

Connect to the recognizer

function connect(token: string, cb?: () => void, err?: (e: string) => void)

Parameters

token

string

cb

() => void

err

(e: string) => void

disconnect(() => void, (e: string) => void)

Disconnect from the recognizer

function disconnect(cb?: () => void, err?: (e: string) => void)

Parameters

cb

() => void

err

(e: string) => void

enableTelemetry(boolean)

This method globally enables or disables telemetry.

static function enableTelemetry(enabled: boolean)

Parameters

enabled

boolean

Global setting for telemetry collection. If set to true, telemetry information like microphone errors, recognition errors are collected and sent to Microsoft. If set to false, no telemetry is sent to Microsoft.

isDisposed()

function isDisposed()

Returns

boolean

sendRequest(string, () => void, (e: string) => void)

Send the mute all participants command to the websocket

function sendRequest(command: string, cb?: () => void, err?: (e: string) => void)

Parameters

command

string

cb

() => void

err

(e: string) => void