Speech-to-text API
Vivox uses the following speech-to-text transcription methods.
Enable or disable transcription
IVivoxService.SpeechToTextEnableTranscription
await VivoxService.Instance.SpeechToTextEnableTranscription( _channelName);
Use this method to enable the speech-to-text audio transcription feature inside a channel. This method takes the following parameter:
ChannelName
: The name of the channel where you enable transcription.
IVivoxService.SpeechToTextDisableTranscription
await VivoxService.Instance.SpeechToTextDisableTranscription( _channelName);
Use this method to disable the speech-to-text audio transcription feature inside a channel. This method takes the following parameter:
ChannelName
: The name of the channel where you disable transcription.
IVivoxService.IsSpeechToTextEnabled
bool isSpeechToTextEnabled = VivoxService.Instance.IsSpeechToTextEnabled(_channelName);
Use this method to check if the transcription is enabled or disabled inside a channel. This method takes the following parameter:
ChannelName
: The name of the channel to check if transcription is enabled.
Transcription notification
IVivoxService.SpeechToTextMessageReceived
VivoxService.Instance.SpeechToTextMessageReceived += OnSpeechTotextMessageAdded;
VivoxService.Instance.SpeechToTextMessageReceived -= OnSpeechTotextMessageAdded;
private void OnSpeechTotextMessageReceived(VivoxMessage message)
{
// Add your code here. “message” is the new transcribed message
// added to the queue.
}
Bind/Unbind this event handler to a method to receive a notification when a transcribed message is added.
Set transcription languages
LoginOptions.SpeechToTextLanguages
loginOptions = loginOptions ?? new LoginOptions();
loginOptions.SpeechToTextLanguages = new List<string>{"en", "es", "fr"};
A list of languages used as hints for audio transcription. The default is an empty array, which implies en
. You can specify up to three spoken languages in order of preference to inform the transcription of all users in transcribed channels. IETF language tag strings are not validated but are expected to conform to BCP47(RFC Editor).