Microsoft Speech Plataform in Portuguese

0

Hello, I have an application using speech recognition that works very well in English (en-US), however when I tried to use it in Portuguese (pt-BR) the results are terrible, it seems to be trying to recognize another language! Am I 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-US)

Microsoft 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}");
    }
    
asked by anonymous 02.08.2016 / 15:28

1 answer

0
  • First install the Microsoft Speech Platform - Runtime (Version 11) for your platform. Here are 32 and 64
  • Install the Heloisa version 11 voice pack (This installer does not have much elegance, soon it closes and is ready, but that's it) Here you have several options . Test with Heloisa first, because the tutorial is done for her.
  • Run the TTS_MS_en-BR_Heloisa_11.0.reg script for your platform (32 or 64)
  • Done, now it should work without any problems.
  • Testedo in Windows 7 64 ok

    Tested on Windows 8 64 ok

    Files:

    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"
    
        
    07.06.2018 / 20:44