


if already transcribing, stop speech recognizer

Recognizer = new SpeechRecognizer(config) Var config = SpeechConfig.FromSubscription(Constants.CognitiveServicesApiKey, Constants.CognitiveServicesRegion) UpdateTranscription("Please grant access to the microphone!") EARLY OUT: make sure mic is accessible MicService = DependencyService.Resolve() Īsync void TranscribeClicked(object sender, EventArgs e)īool isMicEnabled = await micService.GetPermissionAsync() Public partial class MyPage : ContentPageĪudioRecorderService recorder = new AudioRecorderService() If the user starts by selecting the Transcribe button and enters the appropriate voice command, they should hear back the secret phrase, but the playback volume is so low when testing on a physical IOS device I can barely hear it.Ĭode-behind namespace CognitiveSpeechService
Azure speech to text xamarin code#
I cloned the code and adapted the Xaml and CS for the MainPage slightly, as shown below, to stop the speech recognition service once a certain voice command is triggered and then activate a phrase to be spoken via the Text-To-Speech service. I tried to produce a working example by adapting the sample code for Azure Cognitive Speech Service. 'Secret command') via Speech-To-Text, the user can hear the secret phrase back at full/normal volume through Text-To-Speech in a Xamarin Forms application. I'm ideally looking for a way to revert this so that once the appropriate voice command is recognised (i.e. The issue is that when you start recording audio for the Speech-To-Text service, the device's audio is set to recording mode (not sure what the technical term for this is called) and playback audio is set to a very low volume (as described in this SO question and here) and here. I am trying to create an app that takes user input in the form of a voice command (using Speech-To-Text) and outputs an audio announcement from the application (using Text-To-Speech). Disclaimer: I am a newbie to c# and Xamarin.Forms - sorry for missing anything obvious.
