引用的是lichenying的代码
原文链接:https://blog.csdn.net/lichenying/article/details/107244198
在安卓上测试可以
html
<button @click="voice">识别3</button>
<view>{{ff}}</view>
js
voice() {
var me = this;
var options = {};
options.engine = 'iFly';
options.punctuation = false; // 是否需要标点符号
options.timeout = 10 * 1000;
plus.speech.startRecognize(options, function(s) {
me.searchText = me.searchText + s;
console.log(me.searchText)//拿到语音识别的结果
//下面是逻辑
me.ff = s;
me.searchText = ""
plus.speech.stopRecognize();
});
},