From 8ad3a8bdee675ff4c4409f1ea9a6f68f12754322 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Fri, 17 May 2024 13:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=AD=E9=9F=B3=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E8=B0=83=E7=94=A8=E5=87=BD=E6=95=B0=E5=87=BA=E9=94=99?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/audio.py | 8 +++++--- utils/my_handle.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/audio.py b/utils/audio.py index 677dd618..8fe5e307 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -424,9 +424,9 @@ def get_priority_level(data_json): # 查找插入位置 new_data_priority = get_priority_level(data_json) - logging.info(f"{type} 优先级: {new_data_priority}") - if type == "等待合成消息": + logging.info(f"{type} 优先级: {new_data_priority} 内容:【{data_json['content']}】") + # 如果新数据没有 'type' 键或其类型不在 priority_mapping 中,直接插入到末尾 if new_data_priority is None: insert_position = len(Audio.message_queue) @@ -459,6 +459,8 @@ def get_priority_level(data_json): return {"code": 200, "msg": f"数据已插入到位置 {insert_position}"} else: + logging.info(f"{type} 优先级: {new_data_priority} 音频={data_json['voice_path']}") + # 如果新数据没有 'type' 键或其类型不在 priority_mapping 中,直接插入到末尾 if new_data_priority is None: insert_position = len(Audio.voice_tmp_path_queue) @@ -479,7 +481,7 @@ def get_priority_level(data_json): # 数据队列数据量超长判断,插入位置索引大于最大数,则说明优先级低与队列中已存在数据,丢弃数据 if insert_position >= int(self.config.get("filter", "voice_tmp_path_queue_max_len")): - logging.info(f"voice_tmp_path_queue 已满,数据丢弃:【{data_json['voice_path']}】") + logging.info(f"voice_tmp_path_queue 已满,音频丢弃:【{data_json['voice_path']}】") return {"code": 1, "msg": f"voice_tmp_path_queue 已满,音频丢弃:【{data_json['voice_path']}】"} # 获取线程锁,避免同时操作 diff --git a/utils/my_handle.py b/utils/my_handle.py index ee2663e1..8fa0e22d 100644 --- a/utils/my_handle.py +++ b/utils/my_handle.py @@ -3157,7 +3157,7 @@ def process_last_data(self, timer_flag): elif timer_flag == "talk": # 聊天暂时共用弹幕处理逻辑 for data in timer.last_data: - self.comment_handle(data) + self.talk_handle(data) #self.comment_handle(timer.last_data) elif timer_flag == "schedule": # 定时任务处理