Привет всем. Проблема с работой Microsoft Speech Platform с русским языком. Английский работает без проблем. Выдает ошибку на sre.LoadGrammar(g); (The language for the grammar does not match the language of the speech recognizer.)
String voice_lang;
if (lang == "rus") voice_lang = "ru-RU";
else { voice_lang = "en-US"; }
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(voice_lang);
SpeechRecognitionEngine sre = new SpeechRecognitionEngine(ci);
sre.SetInputToDefaultAudioDevice();
sre.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(SayStart);
Choices start_ = new Choices();
if (lang == "eng") { start_.Add(new string[] { "start" }); }
else { start_.Add(new string[] { "начать" }); }
GrammarBuilder gb = new GrammarBuilder();
gb.Append(start_);
Grammar g = new Grammar(gb);
sre.LoadGrammar(g);
sre.RecognizeAsync(RecognizeMode.Multiple);
static void SayStart(object sender, SpeechRecognizedEventArgs e)
{
if (e.Result.Confidence > 0.82) { b.PerformClick(); }
}