<template>
<view class="content">
<button @click="voiceBegain">语音识别</button>
<view v-if="words1">
这是searchValue:{{ words1 }}
</view>
<view v-if="words2">
这是searchText:{{ words2 }}
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
words1: '',
words2: ''
}
},
onLoad() {
},
methods: {
send() {
uniCloud.callFunction({
name: 'sendcode',
success: (e) => {
console.log('这是发送验证码', e);
}
})
},
// 调用讯飞语音识别
voiceBegain() {
// #ifdef APP-PLUS
var options = {
continue: false,
engine: "baidu",
lang: "zh-cn",
nbest: 1,
punctuation: true,
userInterface: true
}
for (var p in options) options[p] = options[p];
plus.speech.startRecognize(options,
(res) => {
callBack(res)
}, (e) => {
console.log(e);
uni.showToast({
icon: "none",
title: "语音识别失败"
});
}
);
// #endif
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 100px;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
打包调试以及真机调试 一直报错 301 VAD detect no speech
0 个回复