AIR Native Extension for OSX - bridge with the NSSpeechRecognizer to add simple speech recognition to your AIR for OSX Desktop Applications
Objective-C ActionScript C
Latest commit af9eb78 Apr 19, 2012 Wouter Verweirder updated readme
Permalink
Failed to load latest commit information.
ane initial commit of the project Apr 19, 2012
as3 code initial commit of the project Apr 19, 2012
demo initial commit of the project Apr 19, 2012
native code initial commit of the project Apr 19, 2012
.gitignore updated readme Apr 19, 2012
readme.md updated readme Apr 19, 2012

readme.md

AIR NSSpeechRecognizer Bridge

Author: Wouter Verweirder

The NSSpeechRecognizerBridge gives you the option to add the simple built-in speech recognition capabilities of your mac to your Adobe AIR Desktop application.

Usage

First of all you need to create an instance of the bridge:

var nsSpeechRecognizerBridge:NSSpeechRecognizerBridge = new NSSpeechRecognizerBridge();

After that, you add a list of valid commands:

nsSpeechRecognizerBridge.setCommands(Vector.<String>([
    "square", 
    "circle",
]));

You add an event handler, which is triggered when a command is recognized:

nsSpeechRecognizerBridge.addEventListener(CommandRecognizedEvent.COMMAND_RECOGNIZED, commandRecognizedHandler);

And you start the recognizer:

nsSpeechRecognizerBridge.startListening();

This will open the speech recognition widget of OSX, with your AIR application. The event handler is triggered when the bridge recognizes one of the commands. The CommandRecognizedEvent object, will contain the command that was recognized:

protected function commandRecognizedHandler(event:CommandRecognizedEvent):void
{
    trace("command recognized: " + event.command);
}

Note that this built-in speech recognition engine is quite sensitive to background noise, and only recognizes US-English spoken words.