Speech Recognition

Easy to use cross platform speech recognition (speech to text) plugin for Xamarin & UWP

Platform Version
iOS 10+
Android 5.x
Windows UWP 16299+
.NET Standard 2.0

SETUP

iOS

Add the following to your

<key>NSSpeechRecognitionUsageDescription</key>  
<string>Say something useful here</string>  
<key>NSMicrophoneUsageDescription</key>  
<string>Say something useful here</string> 

Android

Add the following to your AndroidManifest.xml

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

UWP

Add the following to your app manifest

<Capabilities>
	<Capability Name="internetClient" />
 	<DeviceCapability Name="microphone" />
</Capabilities>

HOW TO USE

Request Permission

var granted = await CrossSpeechRecognition.Current.RequestPermission();
if (granted) 
{
    // go!
}

Continuous Dictation

var listener = CrossSpeechRecognition
    .Current
    .ContinuousDictation()
    .Subscribe(phrase => {
        // will keep returning phrases as pause is observed
    });

// make sure to dispose to stop listening
listener.Dispose();

CrossSpeechRecognition
    .Current
    .ListenUntilPause()
    .Subscribe(phrase => {})

Listen for keywords

CrossSpeechRecognition
    .Current
    .ListenForKeywords("yes", "no")
    .Subscribe(firstKeywordHeard => {})

When can I talk?

CrossSpeechRecognition
    .Current
    .WhenListenStatusChanged()
    .Subscribe(isListening => { you can talk if this is true });

FAQ

  1. Why use reactive extensions and not async?

  2. Speech is very event stream oriented which fits well with RX

  3. Should I use CrossSpeechRecognition.Current?

  4. Hell NO! DI that sucker using the Instance

Roadmap

  • Multilingual
  • Confidence Scoring
  • Mac Support
  • Start and end of speech eventing
  • RMS detection
GitHub