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