Voice Recognition without Grammar

2

I have an example of using Microsoft Speech Api, however all examples of Speech Recognition use Grammar for recognition only of what was pre-defined, I would like to know if I always have to use Grammars or if there is any way to recognize plain text ?

Below the Grammar example:

    SpeechRecognitionEngine sre = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("pt-BR"));

    sre.SetInputToDefaultAudioDevice();//Som capturado pelo microfone

    var estabelecimentos = new Choices("hotel", "restaurante", "cinema", "shopping");
    var locais = new Choices("Rio Grande", "São José do Norte", "Pelotas");


    GrammarBuilder gb = new GrammarBuilder();
    gb.Culture = new System.Globalization.CultureInfo("pt-BR");
    gb.Append("Buscar");
    gb.Append(estabelecimentos);
    gb.Append(new Choices("em", "no"));
    gb.Append(locais);

    gb.Append(new Choices("e", "ou"), 0, 1);
    gb.Append(locais, 0, 1);

    var g = new Grammar(gb);
    sre.LoadGrammarAsync(g);

    sre.EndSilenceTimeout = new TimeSpan(1000);


    sre.SpeechRecognitionRejected += Sre_SpeechRecognitionRejected;
    sre.SpeechRecognized += Sre_SpeechRecognized; ;
    sre.SpeechDetected += Sre_SpeechDetected;


    Console.WriteLine("Ouvindo");
    sre.Recognize();
    
asked by anonymous 17.06.2017 / 16:13

1 answer

0

I searched in several places, I read the Microsoft Speech Platform documentation, and unfortunately I could not recognize plain text, in the documentation, but there is a method in GrammarBuilder, AppendDictation() , which should work for what I wanted, but I found issues in MSDN that they also said that it did not work and that the API is more suitable for commands and not long texts.

The code with AppendDictation ();

gb.AppendDictation();

Official Documentation Link

    
25.06.2017 / 05:34