sapimicrosoft-speech-api

Russian language recognition in Microsoft Speech API


I would like to play a little bit with Microsoft Speech API. I have found this answer and it works! I have tried to adopt it to recognize Russian language. The grammar file look like this:

<GRAMMAR LANGID="419">
    <DEFINE>
        <ID NAME="TEST" VAL="1"/>
    </DEFINE>
    <RULE NAME="TEST" TOPLEVEL="ACTIVE">
        <L>
            <P>Привет</P>
            <P>Пока</P>
        </L>
    </RULE>
</GRAMMAR>

The code is taken from the mentioned answer. But I get an error: the line

HRESULT hr = cpRecoGram->LoadCmdFromFile(L"D:\\data\\test\\reco_ru.cfg", SPLO_STATIC);

returns 0x80045052 (-2147200942): An attempt to load a CFG grammar with a LANGID different than other loaded grammars.

Is it possible to set up a program and/or an environment to use grammar files for Russian?

Environment: Windows 10 Home, Visual Studio 2017


Solution

  • Windows 10 does not ship a SAPI-compatible Russian recognizer as part of the OS. (There are en-US, en-GB, fr-FR, de-DE, ja-JP, zh-CHS, and zh-CHT SAPI recognizers available.)

    However, if you're willing to use the Server recognizers (AKA the MS Speech Platform 11), you can find Russian recognizers at http://www.microsoft.com/en-us/download/details.aspx?id=27224.

    You want the MSSpeech_SR_ru-RU_TELE.msi download.

    The Server recognizers have a similar API, but don't support a number of features that the SAPI 5.4 recognizers support (namely, dictation).