Please correct me if i am wrong actually i am beginner developer. I want to write a speech recognition algorithm for my university project. I want to write speech recognition algorithm for urdu language. Till is it in my mind is that first i should create a urdu grammar. then train the speech recognition engine then detect the word. what i have tried yet...!
- I have written speech recognition algorithm for english.
- I have written 2 words grammar to recognize.
That algorithm is working. So what i should change in the algorithm for recognizing urdu language or to create a urdu grammar. Please guide me where to start.
static void RecognizeSpeechAndMakeSureTheComputerSpeaksToYou()
{
_recognizer = new SpeechRecognitionEngine();
_recognizer.LoadGrammar(new Grammar(new GrammarBuilder("hello computer"))); // load a "hello computer" grammar
_recognizer.SpeechRecognized += _recognizeSpeechAndMakeSureTheComputerSpeaksToYou_SpeechRecognized; // if speech is recognized, call the specified method
_recognizer.SpeechRecognitionRejected += _recognizeSpeechAndMakeSureTheComputerSpeaksToYou_SpeechRecognitionRejected;
_recognizer.SetInputToDefaultAudioDevice(); // set the input to the default audio device
_recognizer.RecognizeAsync(RecognizeMode.Multiple); // recognize speech asynchronous
}
static void _recognizeSpeechAndMakeSureTheComputerSpeaksToYou_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
if (e.Result.Text == "testing")
{
SpeechSynthesizer speechSynthesizer = new SpeechSynthesizer();
speechSynthesizer.Speak("test completed");
speechSynthesizer.Dispose();
}
}