Microsoft Speech Platform in Portuguese

Asked

Viewed 4,236 times

0

Dear people, I have an application using speech recognition that works very well in English (en-US), however when I tried to use for Portuguese (en-BR) the results are terrible, it seems like you are trying to recognize another language! I’m doing something wrong?

What’s right to use, Speech SDK 5.1 or Speech Platform 11.0?

I have installed:

Microsoft Speech Platform x64 v11.0

Microsoft Speech SDK 5.1

Microsoft Speech SDK 5.1 Language Pack

Microsoft Server Speech Recognition Language - TELE (en)

Microsoft Server Speech Recognition Language - TELE (en-US)

And some other languages too.

Here is my code:

public static string ProcessAudio(Stream input, string language)
    {
        try
        {
            _recon = "";

            CultureInfo cInfo = new CultureInfo(language);
            SpeechRecognitionEngine sre = new SpeechRecognitionEngine(cInfo);
            sre.SetInputToWaveStream(input);

            Choices options = new Choices();
            options.Add(new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" });


            options.Add(new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q",
                                       "r", "s", "t", "u", "v", "w", "x", "y", "z" });


            GrammarBuilder gb = new GrammarBuilder();
            gb.Append(new GrammarBuilder(options, 5, 50));
            gb.Culture = cInfo;

            Grammar g = new Grammar(gb);
            sre.LoadGrammar(g);

            sre.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);
            sre.SpeechHypothesized += new EventHandler<SpeechHypothesizedEventArgs>(sre_SpeechHypothesized);

            sre.Recognize();

            sre.Dispose();

            return _recon;
        }
        catch (Exception ex)
        {
            return "";
        }
    }

    static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {
        _recon += e.Result.Text;
        Console.WriteLine(e.Result.Text);
    }

    static void sre_SpeechHypothesized(object sender, SpeechHypothesizedEventArgs e)
    {
        Console.WriteLine($"{e.Result.Text} conf: {e.Result.Confidence}");
    }
  • How does the user interact? What do you want to recognize? Simply spell letters and numbers?

  • Sorry for the delay, I get an audio file with the letters and numbers for interpretation. There is no direct interaction with the user.

1 answer

0


  1. First install Microsoft Speech Platform - Runtime (Version 11) respective your platform. Here’s 32 and 64
  2. Install the Heloisa Voice Pack version 11 (This installer doesn’t have much elegance, so it closes and that’s it, but that’s it) Here you can download several options. Test with Heloisa first, because the tutorial is made for her.
  3. Run the script Tts_ms_en-Br_heloisa_11.0.reg their platform (32 or 64)
  4. Okay, now it should work smoothly.

Tested in Windows 7 64 ok

Tested on Windows 8 64 ok

Archives:

Tts_ms_en-Br_heloisa_11.0 x64.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_pt-BR_Heloisa_11.0]
@="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"416"="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"CLSID"="{a12bdfa1-c3a1-48ea-8e3f-27945e16cf7e}"
"LangDataPath"="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Speech\\Tokens\\TTS_MS_pt-BR_Heloisa_11.0\\MSTTSLocptBR.dat"
"VoicePath"="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Speech\\Tokens\\TTS_MS_pt-BR_Heloisa_11.0\\HeloisaT"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_pt-BR_Heloisa_11.0\Attributes]
@=""
"Age"="Adult"
"Gender"="Female"
"Language"="416"
"Name"="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"Vendor"="Microsoft"
"Version"="11.0"

Tts_ms_en-Br_heloisa_11.0. x86.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_pt-BR_Heloisa_11.0]
@="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"416"="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"CLSID"="{a12bdfa1-c3a1-48ea-8e3f-27945e16cf7e}"
"LangDataPath"="C:\\Program Files\\Common Files\\Microsoft Shared\\Speech\\Tokens\\TTS_MS_pt-BR_Heloisa_11.0\\MSTTSLocptBR.dat"
"VoicePath"="C:\\Program Files\\Common Files\\Microsoft Shared\\Speech\\Tokens\\TTS_MS_pt-BR_Heloisa_11.0\\HeloisaT"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_pt-BR_Heloisa_11.0\Attributes]
@=""
"Age"="Adult"
"Gender"="Female"
"Language"="416"
"Name"="Microsoft Server Speech Text to Speech Voice (pt-BR, Heloisa)"
"Vendor"="Microsoft"
"Version"="11.0"
  • Thanks for the answer, but I’m no longer working on this project, I can’t test the solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.