Coder Social home page Coder Social logo

viure / speechrecognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aritchie/speechrecognition

0.0 2.0 0.0 1.47 MB

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

License: MIT License

C# 98.44% Batchfile 1.56%

speechrecognition's Introduction

ACR Speech Recognition Plugin for Xamarin & Windows

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

NuGet NuGet

PLATFORMS

  • iOS 10+
  • Android
  • Windows UWP

SETUP

iOS Add the following to your NSSpeechRecognitionUsageDescription
Say something useful here
NSMicrophoneUsageDescription
Say something useful here

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 SpeechRecognizer.Instance.RequestPermission();
if (granted) 
{
    // go!
}

Easy Use

SpeechRecognizer.Instance.Listen().Subscribe(x => 
{
	// you will get each individual word the user speaks here
});

Listen for a phrase (good for a web search)

SpeechRecognizer
    .Instance
    .Listen(true) // passing true will complete this observable when the end of speech is detected
    .Subscribe(phrase => {})

Stop the thing!

var token = SpeechRecognizer.Instance.Listen().Subscribe(...);
token.Dispose(); // call this whenever you're done and it will clean up after itself!

When can I talk?

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

Speech Dialogs Addin

Speech dialogs is an additional nuget you can install via nuget to add easy question based prompts. It will prompt the user with questions using Text-to-Speech and you can reply with a selection of answers

Confirm

var answer = await SpeechDialogs.Instance.Confirm("Are you sure you want to do this?", "yes", "no");

Prompt (great for searches)

var prompt = await SpeechDialogs.Instance.Prompt("How was your day?");

Actions

SpeechDialogs.Instance.Actions(new ActionsConfig("Choose your destiny!") 
    .Choice("Fatalitiy", () => 
    { 
        // do something here
    })
    .Choice("Friendship", () => 
    {
    
    })
    .SetShowActionSheet(true) // this will decide if you also want to include the UI dialog
    .SetSpeakChoices(true)    // this will read the choices out that you make available
)

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 SpeechRecognizer.Instance?

A. Hell NO! DI that sucker using the Instance

Roadmap

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

speechrecognition's People

Contributors

aritchie avatar

Watchers

James Cloos avatar Jorge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.