diff --git a/app/DataBase/media_msg.py b/app/DataBase/media_msg.py index 5aba597..4baf912 100644 --- a/app/DataBase/media_msg.py +++ b/app/DataBase/media_msg.py @@ -1,12 +1,15 @@ import os.path import subprocess import sys +import traceback from os import system import sqlite3 import threading import xml.etree.ElementTree as ET from pilk import decode +from app.log import logger + lock = threading.Lock() db_path = "./app/Database/Msg/MediaMSG.db" @@ -95,15 +98,17 @@ class MediaMsg: # system(cmd) # 使用subprocess.run()执行命令 subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + os.remove(silk_path) + os.remove(pcm_path) except Exception as e: print(f"Error: {e}") + logger.error(f'语音发送错误\n{traceback.format_exc()}') cmd = f'''"{os.path.join(os.getcwd(), 'app', 'resources', 'data', 'ffmpeg.exe')}" -loglevel quiet -y -f s16le -i "{pcm_path}" -ar 44100 -ac 1 "{mp3_path}"''' # system(cmd) # 使用subprocess.run()执行命令 subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - os.remove(silk_path) - os.remove(pcm_path) - print(mp3_path) + finally: + print(mp3_path) return mp3_path def get_audio_path(self, reserved0, output_path): diff --git a/app/resources/data/template.html b/app/resources/data/template.html index 9df3090..1d13404 100644 --- a/app/resources/data/template.html +++ b/app/resources/data/template.html @@ -578,7 +578,7 @@ input { // Sample chat messages (replace this with your actual data) const chatMessages = [ /*注意看这是分割线*/ - + ]; function checkEnter(event) { if (event.keyCode === 13) { gotoPage(); diff --git a/app/resources/icons/关闭.svg b/app/resources/icons/关闭.svg new file mode 100644 index 0000000..16e96e1 --- /dev/null +++ b/app/resources/icons/关闭.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/resources/icons/关闭状态.svg b/app/resources/icons/关闭状态.svg new file mode 100644 index 0000000..179d8be --- /dev/null +++ b/app/resources/icons/关闭状态.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/resources/icons/按钮_关闭.svg b/app/resources/icons/按钮_关闭.svg new file mode 100644 index 0000000..fe1ed27 --- /dev/null +++ b/app/resources/icons/按钮_关闭.svg @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/app/resources/icons/按钮_开启.svg b/app/resources/icons/按钮_开启.svg new file mode 100644 index 0000000..131c57a --- /dev/null +++ b/app/resources/icons/按钮_开启.svg @@ -0,0 +1 @@ + \ No newline at end of file