目前,我正在做的PhoneGap应用程序。 我想增强现实EN语音输入相结合。 有一个叫SpeechRecognizer为PhoneGap的插件,但我不能得到它的工作。
我的头:
<script type="text/javascript" src="cordova-2.6.0.js"></script>
<script type="text/javascript" src="SpeechRecognizer.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready", onDeviceReady, false);
function speechOk() {
alert('speech works');
}
function speechFail() {
alert("speech doesn't work");
}
function onDeviceReady() {
window.plugins.speechrecognizer.init(speechOk, speechFail);
}
$("#micButton").bind("touchstart", function() {
var requestCode = 4815162342;
var maxMatches = 1;
var promptString = "What do you want?";
window.plugins.speechrecognizer.startRecognize(speechOk, speechFail, requestCode, maxMatches, promptString);
});
</script>
项目(config.xml文件)的图片:
提前致谢