Back to Uno

Speech Recognition in Uno

doc/articles/features/SpeechRecognition.md

6.6-release-branch-cut3.5 KB
Original Source

Speech Recognition in Uno

[!TIP] This article covers Uno-specific information for Windows.Media.SpeechRecognition. For a full description of the feature and instructions on using it, see SpeechRecognition Namespace.

  • The Windows.Media.SpeechRecognition class allows an application to recognize voice input.

Uno's implementation currently supports basic native speech recognition.

Supported Features

The following features of Windows.Media.SpeechRecognition.SpeechRecognizer are currently supported:

FeatureiOSAndroidRemarks
SpeechRecognizer()XX
SpeechRecognizer(Language)XX
Constraints--
ContinuousRecognitionSession--
CurrentLanguageXX
StateXX
SupportedGrammarLanguages--
SupportedTopicLanguages--
SystemSpeechLanguage--
TimeoutsXX
UIOptionsXXNot used
CompileConstraintsAsync()XXAlways return Success (implemented to meet WinUI constraint that requires CompileConstraintsAsync() to be called before RecognizeAsync())
Dispose()XX
RecognizeAsync()XX
RecognizeWithUIAsync()--
StopRecognitionAsync()()XX
TrySetSystemSpeechLanguageAsync(Language)--
HypothesisGeneratedXX
RecognitionQualityDegrading--
StateChangedXX

Requirement

iOS

  • iOS 10 or later is required.

  • The following lines need to be added to your info.plist:

    xml
    <key>NSSpeechRecognitionUsageDescription</key>  
    <string>[SpeechRecognition usage description]</string>  
    <key>NSMicrophoneUsageDescription</key>  
    <string>[SpeechRecognition usage description]</string> 
    

Android

The following lines need to be added to your AndroidManifest.xml:

xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

Limitation

In Windows.Media.SpeechRecognition.SpeechRecognitionResult, only Text, Alternates, and GetAlternates(uint maxAlternates) are implemented. In particular, RawConfidence and Confidence fields are not currently supported.