'commit'
This commit is contained in:
@@ -215,6 +215,9 @@ const WebSocketManager = {
|
||||
AudioState.playback.audioQueue.push(event.data);
|
||||
console.log('当前音频队列长度:', AudioState.playback.audioQueue.length);
|
||||
|
||||
// 显示播放界面 - 这是新增的代码
|
||||
UIController.toggleElement('audioPlayer', true);
|
||||
|
||||
// 如果尚未开始流式播放,则开始播放
|
||||
if (!AudioState.playback.isStreamPlaying) {
|
||||
console.log('开始流式播放音频');
|
||||
@@ -393,10 +396,15 @@ const AudioPlayer = {
|
||||
|
||||
// 处理音频队列
|
||||
processAudioQueue() {
|
||||
// 在AudioPlayer.processAudioQueue方法中,修改队列为空时的处理
|
||||
// 如果队列为空,则返回
|
||||
if (AudioState.playback.audioQueue.length === 0) {
|
||||
AudioState.playback.isStreamPlaying = false;
|
||||
console.log('音频队列为空,停止流式播放');
|
||||
|
||||
// 隐藏播放界面 - 这是新增的代码
|
||||
UIController.toggleElement('audioPlayer', false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user