Здравствуйте, при попытке распознать речь выкидывается InvalidOperationException
Код:
public class SpeechEngine : IDisposable
{
public string RecognizedText;
Windows.Media.SpeechRecognition.SpeechRecognizer speechRecognizer;
Windows.Media.SpeechRecognition.SpeechRecognitionResult speechRecognitionResult;
public SpeechEngine()
{
speechRecognizer = new Windows.Media.SpeechRecognition.SpeechRecognizer();
}
public async void StartRecognizing()
{
await speechRecognizer.CompileConstraintsAsync();
speechRecognitionResult = await speechRecognizer.RecognizeAsync();
}
public async void StopRecognizing()
{
await speechRecognizer.StopRecognitionAsync();
RecognizedText = speechRecognitionResult.Text;
}
public void Dispose()
{
speechRecognizer.Dispose();
}
}
В манифесте разрешение есть для использования микрофона. Проект UWP