Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi.
I am working on a small application for android using xamarin.android and c#, a part of it is listening to user speech!
I am using Android.Speech.SpeechRecognizer for this.
this is my code :
C#
Android.Speech.SpeechRecognizer sp = Android.Speech.SpeechRecognizer.CreateSpeechRecognizer(this);
            sp.SetRecognitionListener(this);

Intent intent = new Android.Content.Intent(Android.Speech.RecognizerIntent.ActionRecognizeSpeech);
intent.PutExtra(Android.Speech.RecognizerIntent.ExtraLanguageModel, Android.Speech.RecognizerIntent.LanguageModelFreeForm);
intent.PutExtra(Android.Speech.RecognizerIntent.ExtraCallingPackage, "voice.recognition.test");
intent.PutExtra(Android.Speech.RecognizerIntent.ExtraMaxResults, 5); 

sp.BeginningOfSpeech += new EventHandler(sp_BeginningOfSpeech);
sp.ReadyForSpeech += new EventHandler<Android.Speech.ReadyForSpeechEventArgs>(sp_ReadyForSpeech);

button.Click += delegate
{
    sp.StartListening(intent);
};


when i run this, i didnt recieve any event. whats problem?!

thank you for your spent time!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900