Skip to content

Instantly share code, notes, and snippets.

@mumumu
Created May 3, 2012 09:04
Show Gist options
  • Save mumumu/2584507 to your computer and use it in GitHub Desktop.
Save mumumu/2584507 to your computer and use it in GitHub Desktop.
Voice Recognition sample for Titanium Mobile
//Add behavior for UI
label.addEventListener('click', function(e) {
var intent = Ti.Android.createIntent({
action: "android.speech.action.RECOGNIZE_SPEECH"
});
intent.putExtra("android.speech.extra.LANGUAGE_MODEL", "free_form");
intent.putExtra("android.speech.extra.PROMPT","VoiceRecognitionTest");
//intent発行&音声認識結果受け取り
Ti.Android.currentActivity.startActivityForResult(
intent,
function(e){
alert("voice recognition activity returned!");
}
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment