4

I just downloaded the fr-FR runtime language pack so that I can recognize French speech through my program.

However, my program throws the error

Additional information: No recognizer of the required ID found.

at

SpeechRecognitionEngine recognizer = 
    new SpeechRecognitionEngine(new System.Globalization.CultureInfo("fr-FR"));

en-US and en-GB works because they are pre-installed with my system, I just installed these new language packs but they are still throwing this exception.

Also, if this helps, when I do

foreach (var x in SpeechRecognitionEngine.InstalledRecognizers())
{
    Console.Out.WriteLine(x.Name);
}

it prints

MS-1033-80-DESK

EDIT: This is not a possible duplicate because this isn't about having no recognizers installed, it's about C# SAPI not seeing that I have the installed pack for the current language

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
rakagunarto
  • 325
  • 3
  • 23

2 Answers2

4

I was able to get this to work... there is an extra step involved.

Since you're using System.Speech, it uses the installed Desktop speech recognition that comes with Windows. The error you're getting is not because you don't have the language installed, but because you didn't install the speech recognizer for that language.

So, head on over to Setting > Time and Language > Region and language (which is probably where you installed the language from). After you install the language, select the language, and click 'Options'. You should see options to download the language pack, spell checking, and the one we're interested in, Speech. Click Download, and wait for the download/install to finish.

Once it's done, you won't get a notification, but you can go into Settings > Time and Language > Speech and see your installed recognizers there, or you can go to Settings > Speech Recognition > Advanced Speech Options to see the same list.

Now when you run your program, it should work. BTW, if you want to see the installed speech recognizers in your code, use this instead:

foreach (var x in SpeechRecognitionEngine.InstalledRecognizers())
            {
                Console.WriteLine(x.Culture.Name);   
            }

You only get a code when asking for the recognizers name, you want the culture's name. (as you saw, MS-1033-80-DESK corresponds to en-US. For reference, fr-FR is MS-1036-80-DESK).

DrewJordan
  • 5,266
  • 1
  • 25
  • 39
  • Now I have another problem, setInputToDefaultAudioDevice() is throwing an InvalidOperationException – rakagunarto Oct 23 '15 at 10:47
  • I can try to help, but you should enter it as a separate question. The first thing I would do is open the Windows Speech Recognition application and see if you can work with that... You should double-check your input devices and make sure that the right microphone is selected as your default input device, and that it's enabled. – DrewJordan Oct 23 '15 at 11:51
  • Okay apparently it tried to use the Microsoft.Speech setAudioDevice thing so I set it to use the System.Speech one and it worked. But I realised I want to use Microsoft.Speech because it is made to work with lower quality audio, and the Microsoft.Speech setInputToDefaultAudioDevice throws that exception, I asked a question on MSDN, can you help there? https://social.msdn.microsoft.com/Forums/vstudio/en-US/72ea511e-a714-460c-a59b-506b1f0e11f7/microsoftspeech-speechrecognitionenginesetinputtodefaultaudiodevice-method-throwing?forum=csharpgeneral – rakagunarto Oct 23 '15 at 12:24
  • http://stackoverflow.com/questions/33318596/microsoft-speech-speechrecognitionengine-setinputtodefaultaudiodevice-method-t I asked another question about it... – rakagunarto Oct 25 '15 at 03:43
2

Is it possible that you installed the Microsoft Speech Platform French language pack? Such as the ones seen here? MS Speech Platform Language Packs

If that's the case then it won't appear as an installed language for what you're doing. To get it to work, from what I understand, you will need a language pack installed for French instead which is only available for Windows Ultimate and Enterprise editions if you're using a non-French version of windows.

If that's impossible, then you might have to figure out how to use the Microsoft Speech Platform SDK vs Windows/SAPI. Right now it seems like you're trying to use Windows/SAPI with a Speech Platform Recognizer. Here's the MS page the shows the difference between the MS Speech Platform vs. Windows/SAPI

DrewJordan
  • 5,266
  • 1
  • 25
  • 39
Lesley Gushurst
  • 664
  • 4
  • 15