Created
May 6, 2012 15:53
-
-
Save mumumu/2623056 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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