UPDATE - This library has now moved to the Shiny Framework at https://github.com/shinyorg/shiny
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 |
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>
Add the following to your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Add the following to your app manifest
<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="microphone" />
</Capabilities>
var permission = await CrossSpeechRecognition.Current.RequestPermission();
if (permission == SpeechRecognizerStatus.Available)
{
// go!
}
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 => {})
CrossSpeechRecognition
.Current
.ListenForKeywords("yes", "no")
.Subscribe(firstKeywordHeard => {})
CrossSpeechRecognition
.Current
.WhenListenStatusChanged()
.Subscribe(isListening => { you can talk if this is true });
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
- Multilingual
- Confidence Scoring
- Mac Support
- Start and end of speech eventing
- RMS detection