Created
May 3, 2012 09:04
-
-
Save mumumu/2584507 to your computer and use it in GitHub Desktop.
Voice Recognition sample for Titanium Mobile
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
//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