/speechrecognition

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

Primary LanguageC#MIT LicenseMIT

UPDATE - This library has now moved to the Shiny Framework at https://github.com/shinyorg/shiny

ACR Speech Recognition Plugin for Xamarin & Windows

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

Change Log - October 13, 2018

NuGet Build status

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

SETUP

iOS

Add the following to your Info.plist

<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 permission = await CrossSpeechRecognition.Current.RequestPermission();
if (permission == SpeechRecognizerStatus.Available) 
{
    // 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();

Listen for a phrase (good for a web search)

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

Q. Why use reactive extensions and not async?

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

Q. Should I use CrossSpeechRecognition.Current?

A. Hell NO! DI that sucker using the Instance

Roadmap

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