|
@ -69,8 +69,6 @@ |
|
|
:class="voicePadConfig.step==2?'voice_img_playing':''"></image> |
|
|
:class="voicePadConfig.step==2?'voice_img_playing':''"></image> |
|
|
<view class="voice_btn " @longpress="longPressHandle" @touchend="touchEndHandle" |
|
|
<view class="voice_btn " @longpress="longPressHandle" @touchend="touchEndHandle" |
|
|
hover-class="btn_active" v-if="voicePadConfig.step<3">按住说话</view> |
|
|
hover-class="btn_active" v-if="voicePadConfig.step<3">按住说话</view> |
|
|
<!-- <view class="voice_btn btn_active" v-else-if="voicePadConfig.step==2">按住说话</view> --> |
|
|
|
|
|
<!-- hover-class --> |
|
|
|
|
|
<view class="v_btns" v-else-if="voicePadConfig.step==3"> |
|
|
<view class="v_btns" v-else-if="voicePadConfig.step==3"> |
|
|
<view class="voice_btn btn_white" @click="sendVoice()">发送</view> |
|
|
<view class="voice_btn btn_white" @click="sendVoice()">发送</view> |
|
|
<view class="voice_btn btn_green" @click="listenVoice()">听取录音</view> |
|
|
<view class="voice_btn btn_green" @click="listenVoice()">听取录音</view> |
|
@ -191,7 +189,6 @@ |
|
|
console.log("文字转语音"); |
|
|
console.log("文字转语音"); |
|
|
this.voicePadConfig.showVoicePad = true |
|
|
this.voicePadConfig.showVoicePad = true |
|
|
this.voicePadConfig.step = 0 |
|
|
this.voicePadConfig.step = 0 |
|
|
// this.voicePadConfig |
|
|
|
|
|
} else { //语音发送 |
|
|
} else { //语音发送 |
|
|
console.log("语音发送"); |
|
|
console.log("语音发送"); |
|
|
this.voicePadConfig.showVoicePad = true |
|
|
this.voicePadConfig.showVoicePad = true |
|
@ -235,7 +232,7 @@ |
|
|
"url": _url |
|
|
"url": _url |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
"token": "f0d5c19b-b87e-11eb-bc7d-5254005df464" |
|
|
|
|
|
|
|
|
// "token": "f0d5c19b-b87e-11eb-bc7d-5254005df464" |
|
|
} |
|
|
} |
|
|
//发送命令到中控 |
|
|
//发送命令到中控 |
|
|
this.operateReq({ |
|
|
this.operateReq({ |
|
@ -247,6 +244,7 @@ |
|
|
async listenVoice() { |
|
|
async listenVoice() { |
|
|
if(this.voicePadConfig.step==0){ |
|
|
if(this.voicePadConfig.step==0){ |
|
|
//需要将语音下载到本地,然后播放 |
|
|
//需要将语音下载到本地,然后播放 |
|
|
|
|
|
let txt = this.voicePadConfig.txt; |
|
|
let url =`${deviceApi.ORIGIN}/ouxuanac/tts/textToVoice.wav?text=${txt}&voice_type=4&speed=-1&volume=10`; |
|
|
let url =`${deviceApi.ORIGIN}/ouxuanac/tts/textToVoice.wav?text=${txt}&voice_type=4&speed=-1&volume=10`; |
|
|
let updated_url = await this.getDownloadUrl(url) |
|
|
let updated_url = await this.getDownloadUrl(url) |
|
|
innerAudioContext.src = updated_url |
|
|
innerAudioContext.src = updated_url |
|
|