x***@sina.com
x***@sina.com
  • 发布:2022-06-30 15:49
  • 更新:2022-06-30 15:49
  • 阅读:550

Uni-app百度语音识别报错VAD detect no speech

分类:uni-app
<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

2022-06-30 15:49 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复