如何解决UWP中SpeechRecognizer引发的COMException(0x80070490)错误?
Hey there, sorry you're stuck with this frustrating error when using SpeechRecognizer in your UWP app. Since you've already checked the basics (enabled Internet Client and Microphone capabilities, tried a clean manifest), let's dive into some other likely fixes specific to Windows 10 Build 1709:
Verify Windows Speech Recognition Feature is Enabled
Even if your app has permissions, the underlying OS feature might be disabled. Go to Settings > Time & Language > Speech and make sure:- "Online speech recognition" is toggled on (required for cloud-based recognition)
- The appropriate offline speech pack is installed if you're using offline recognition (look under "Speech languages")
Check Dependent Windows Services
The error 0x80070490 often means a required component is missing or not running. Open the Services app (press Win+R, typeservices.msc) and ensure these services are running and set to Automatic startup:- Windows Audio
- Windows Audio Endpoint Builder
- Speech Recognition Service (sapisvr.exe)
Confirm App Privacy Permissions
Double-check that your app has explicit access to the microphone at the system level. Go to Settings > Privacy > Microphone and make sure your app is listed and has permission enabled. Sometimes adding capabilities in the manifest doesn't automatically grant system-level access, especially if the app was installed previously.Explicitly Set Recognizer Language
On older Windows 10 builds like 1709, the SpeechRecognizer might fail if it can't auto-detect the system language. Try initializing it with a specific supported language instead of relying on the default:var recognizer = await SpeechRecognizer.TryCreateAsync(new Windows.Globalization.Language("en-US")); if (recognizer == null) { // Handle case where recognizer isn't available Debug.WriteLine("SpeechRecognizer could not be initialized"); return; }Using
TryCreateAsync()instead of direct instantiation also helps catch cases where the recognizer isn't available for the selected language.Check Minimum Target Version
Ensure your app's minimum target version is set to Windows 10 Build 1709 or lower. If it's set to a higher version, it might introduce compatibility issues with your OS build. You can adjust this in your project properties under the "Application" tab.Test with a Minimal Reproduction
Since your code snippet was cut off, try creating a tiny test UWP app with just the SpeechRecognizer initialization and a simple recognition call. This can help rule out conflicts with other parts of your app (like audio processing or background tasks) that might be interfering.
If none of these steps work, it might be a known bug in Windows 10 1709. Consider checking if there are any pending Windows updates for your build, as Microsoft released patches for speech-related issues in later updates for 1709.
内容的提问来源于stack exchange,提问作者stickfigure4

