feat: 先关闭语音
This commit is contained in:
@@ -76,6 +76,7 @@
|
||||
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<yao-asdRealSpeech
|
||||
v-if="isSpeechRecognitionSupported"
|
||||
ref="appSpeechRef"
|
||||
:options="appSpeechOptions"
|
||||
@result="handleAppSpeechResult"
|
||||
@@ -97,6 +98,7 @@ import { appSpeechRecognitionOptions } from "@/constant/speech";
|
||||
|
||||
let manager = null;
|
||||
let speechProvider = "";
|
||||
const isSpeechRecognitionEnabled = ref(false);
|
||||
const isSpeechRecognitionSupported = ref(false);
|
||||
const appSpeechOptions = appSpeechRecognitionOptions;
|
||||
|
||||
@@ -104,13 +106,13 @@ const appSpeechOptions = appSpeechRecognitionOptions;
|
||||
// #ifdef MP-WEIXIN
|
||||
const plugin = requirePlugin("WechatSI");
|
||||
manager = plugin.getRecordRecognitionManager();
|
||||
isSpeechRecognitionSupported.value = !!manager;
|
||||
isSpeechRecognitionSupported.value = isSpeechRecognitionEnabled.value && !!manager;
|
||||
speechProvider = manager ? "wechat" : "";
|
||||
// #endif
|
||||
|
||||
// App 端使用 yao-asdRealSpeech;apikey 请在 src/constant/speech.js 中配置。
|
||||
// #ifdef APP-PLUS
|
||||
isSpeechRecognitionSupported.value = true;
|
||||
isSpeechRecognitionSupported.value = isSpeechRecognitionEnabled.value;
|
||||
speechProvider = "app";
|
||||
// #endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user