Fix(云灵AI):[#5394]在云灵ai历史记录对话窗口,点击【语音播放】,播放中时点击重新生成,语音播放还在继续
This commit is contained in:
@@ -100,10 +100,7 @@ export const chatMixins = {
|
||||
}.bind(this)).exec()
|
||||
},
|
||||
onUnload() {
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
}
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
this.audioStopHandle()
|
||||
this.closeWsFn()
|
||||
},
|
||||
created() {
|
||||
@@ -447,9 +444,15 @@ export const chatMixins = {
|
||||
this.audioAyy = []
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
this.audioContext.destroy() // 强制销毁释放资源
|
||||
this.audioContext = null
|
||||
}
|
||||
this.isPlayAudio = false
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
|
||||
// 强制关闭微信小程序背景音频
|
||||
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
}
|
||||
},
|
||||
ttsHandle(item) {
|
||||
this.audioAyy = []
|
||||
|
||||
@@ -81,10 +81,7 @@ export const chatMixinsV2 = {
|
||||
}.bind(this)).exec()
|
||||
},
|
||||
onUnload() {
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
}
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
this.audioStopHandle()
|
||||
this.closeWsFn()
|
||||
},
|
||||
created() {
|
||||
@@ -670,9 +667,15 @@ export const chatMixinsV2 = {
|
||||
this.audioAyy = []
|
||||
if (this.audioContext) {
|
||||
this.audioContext.stop()
|
||||
this.audioContext.destroy() // 强制销毁释放资源
|
||||
this.audioContext = null
|
||||
}
|
||||
this.isPlayAudio = false
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
|
||||
// 强制关闭微信小程序背景音频
|
||||
if (typeof wx !== 'undefined' && wx.getBackgroundAudioManager) {
|
||||
wx.getBackgroundAudioManager().stop()
|
||||
}
|
||||
},
|
||||
ttsHandle(item) {
|
||||
this.audioAyy = []
|
||||
|
||||
Reference in New Issue
Block a user