3

I'm setting up an application for Android using Unity, where I want to apply speech to text functionalities, for that purpose I'm using the SDK of Azure's Speech-Service. The problem is that when I say a word, the recognizer tries to guess the word instead of even considering what I was saying, for example when saying pseudowords.

That's why I wanted to implement the Phrase List, which it's suppose to help you improving the accuracy of speech recognition.

So I used the PhraseListGrammar Class, and it was working well when using "en-US" as the SpeechRecognitionLanguage but when I try to do the same when using "en-ES" it just omits all the phrases added and the problem persist for all the other languages, perhaps there's something I'm doing wrong.

Yesterday I was trying this and it was working like a charm when using "en-US", now it's not working so there must be something missing.

    var config = SpeechConfig.FromSubscription("mysubscriptionkey", "westus2");
    // config.SpeechRecognitionLanguage = "en-US";
    config.SpeechRecognitionLanguage = "es-ES";
    config.OutputFormat = OutputFormat.Detailed;

    using (var recognizer = new SpeechRecognizer(config))
    {
        lock (threadLocker)
        {
            waitingForReco = true;
        }
        PhraseListGrammar phraseList = PhraseListGrammar.FromRecognizer(recognizer);
        phraseList.AddPhrase("Mover un badodo");
        phraseList.AddPhrase("lolololalala");
        phraseList.AddPhrase("badodo");


        var result = await recognizer.RecognizeOnceAsync().ConfigureAwait(false);

        if (result.Reason == ResultReason.RecognizedSpeech)
        {
            consoleMessage = JsonConvert.SerializeObject(result.Best());
            newMessage = JsonConvert.SerializeObject(result);
        }
        else if (result.Reason == ResultReason.NoMatch)
        {
            newMessage = "NOMATCH: Speech could not be recognized.";
        }
        else if (result.Reason == ResultReason.Canceled)
        {
            var cancellation = CancellationDetails.FromResult(result);
            newMessage = $"CANCELED: Reason={cancellation.Reason} ErrorDetails={cancellation.ErrorDetails}";
        }

        lock (threadLocker)
        {
            cmessage = consoleMessage;
            message = newMessage;
            waitingForReco = false;
        }
    }

I expected it to improve the recognition of the added keywords, but It's not working.

gps_itsec
  • 41
  • 5

0 Answers0