From 8c0b8e9d84b82d461ad86a9f3a3a4c0299857b3a Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Sun, 17 Dec 2023 21:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dapi=20=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api.py b/api.py index 8ba8dd60..86b68f5d 100644 --- a/api.py +++ b/api.py @@ -1,6 +1,6 @@ import logging, os, sys, json import threading -import schedule +import schedule, time import random import aiohttp, asyncio import traceback @@ -1394,9 +1394,11 @@ def run_live(self): # 冷却时间 0.3 秒 cooldown = 0.3 last_pressed = 0 + + stop_do_listen_and_comment_thread_event = threading.Event() - signal.signal(signal.SIGINT, exit_handler) - signal.signal(signal.SIGTERM, exit_handler) + # signal.signal(signal.SIGINT, exit_handler) + # signal.signal(signal.SIGTERM, exit_handler) # 录音功能(录音时间过短进入openai的语音转文字会报错,请一定注意) def record_audio(): @@ -2026,7 +2028,7 @@ def sys_cmd(): if data_json['type'] == 'run': """ { - "type": "factory", + "type": "run", "data": { "config_path": "config.json" } @@ -2037,7 +2039,7 @@ def sys_cmd(): elif data_json['type'] =='stop': """ { - "type": "factory", + "type": "stop", "data": { "config_path": "config.json" }