I'm getting a System.Runtime.InteropServices.COMException (0x80070490) using SpeechRecognizer.
I've read online that this error might be caused by a capability not being enabled or that the manifest is corrupt.
I have Internet (Client) and Microphone enabled, I also tried a clean manifest file, but it results in the same error message.
Does anybody know what I'm doing wrong? This is an UWP app and I'm using Windows 10 Build 1709.
My code:
using System;
using System.Diagnostics;
using Windows.Media.SpeechRecognition;
namespace SpeechRecognitionRPi
{
class SpeechHandling
{
public async void StartRecognition()
{
// Create an instance of SpeechRecognizer.
var speechRecognizer = new SpeechRecognizer();
// Compile the dictation grammar by default.
await speechRecognizer.CompileConstraintsAsync();
// Start recognition.
SpeechRecognitionResult speechRecognitionResult = await speechRecognizer.RecognizeWithUIAsync();
// Do something with the recognition result.
var messageDialog = new Windows.UI.Popups.MessageDialog(speechRecognitionResult.Text, "Text spoken");
await messageDialog.ShowAsync();
}
}
}
Fixed by enabling the English-US language in Windows, you also need to install the speech module from Language options.
User contributions licensed under CC BY-SA 3.0