Skip to content

Instantly share code, notes, and snippets.

@mumumu
Created May 6, 2012 15:53
Show Gist options
  • Save mumumu/2623056 to your computer and use it in GitHub Desktop.
Save mumumu/2623056 to your computer and use it in GitHub Desktop.
if (Ti.Platform.name == "android") {
var speechModule = require('org.mumumu.ti.android.speech');
var voiceRecognitionProxy = speechModule.createVoiceRecognition();
voiceRecognitionProxy.callback = function (e) {
var voice_recognition_enabled = e.voice_enabled;
var voice_results = e.voice_results;
if (e.voice_canceled) {
alert("voice recognition canceled");
} else {
if (!voice_recognition_enabled) {
alert("voice recognition seems to be disabled");
} else {
alert(voice_results[0]);
}
}
};
voiceRecognitionProxy.voiceRecognition();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment