使用cordova-plugin-IFlyspeech插件
添加插件 : cordova plugin add
https
://github.com/Edc-zhang/cordova-plugin-IFlyspeech
完事 去科大讯飞官网申请appid
在插件文件夹的xml文件,把appid替换成自己的.
这文件好像不能替,本想拿科大官网下载的sdk包,替换下,结果总会报错,如下:
(打包时报错)
在项目内,定义方法,
xunfeiListenSpeaking.startListen(function(str) { // this is what the device hear and understand alert(str) },function (err) { alert(err) },true,true);
打包 初试成功