views:

27

answers:

0

With the code below it works and return the first recognition, but not the everything else. What am I doing wrong? Am I suppose to be in some kind of loop?

    public void Transcribe()
    {
        SpeechRecognitionEngine SRE = new SpeechRecognitionEngine();
        SRE.LoadGrammar(new DictationGrammar());

        SRE.SetInputToWaveFile(_fileName);
        SRE.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(SRE_SpeechRecognized);
        SRE.RecognizeCompleted += new EventHandler<RecognizeCompletedEventArgs>(SRE_RecognizeCompleted);
        SRE.RecognizeAsync(RecognizeMode.Multiple);    
    }

    void SRE_RecognizeCompleted(object sender, RecognizeCompletedEventArgs e)
    {
        Console.WriteLine(e.Result.Text);
    }

    void SRE_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {            
    }