Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
/ speechrecognition Public archive

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

License

Notifications You must be signed in to change notification settings

aritchie/speechrecognition

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published