Speech-to-text API
Use the speech-to-text API to transcribe voice messages.
Read time 1 minuteLast updated 2 days ago
Vivox uses the following speech-to-text transcription methods.
Enable or disable transcription
IVivoxService.SpeechToTextEnableTranscription
IVivoxService.SpeechToTextEnableTranscriptionUse this method to enable the speech-to-text audio transcription feature inside a channel. This method takes the following parameter:await VivoxService.Instance.SpeechToTextEnableTranscription( _channelName);
ChannelNameIVivoxService.SpeechToTextDisableTranscription
IVivoxService.SpeechToTextDisableTranscriptionUse this method to disable the speech-to-text audio transcription feature inside a channel. This method takes the following parameter:await VivoxService.Instance.SpeechToTextDisableTranscription( _channelName);
ChannelNameIVivoxService.IsSpeechToTextEnabled
IVivoxService.IsSpeechToTextEnabledUse this method to check if the transcription is enabled or disabled inside a channel. This method takes the following parameter:bool isSpeechToTextEnabled = VivoxService.Instance.IsSpeechToTextEnabled(_channelName);
ChannelNameTranscription notification
IVivoxService.SpeechToTextMessageReceived
IVivoxService.SpeechToTextMessageReceivedBind/Unbind this event handler to a method to receive a notification when a transcribed message is added.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.}
Set transcription languages
LoginOptions.SpeechToTextLanguages
LoginOptions.SpeechToTextLanguagesA list of languages used as hints for audio transcription. The default is an empty array, which impliesloginOptions = loginOptions ?? new LoginOptions();loginOptions.SpeechToTextLanguages = new List<string>{"en", "es", "fr"};
en