diff --git a/core/fay_core.py b/core/fay_core.py index 1caf252..1d6be3c 100644 --- a/core/fay_core.py +++ b/core/fay_core.py @@ -164,10 +164,7 @@ class FeiFei: #指令 keyword = qa_service.question('command',text) if keyword is not None: - if keyword == "playSong": - MyThread(target=self.__play_song).start() - wsa_server.get_web_instance().add_cmd({"panelMsg": ""}) - elif keyword == "stop": + if keyword == "stop": fay_booter.stop() wsa_server.get_web_instance().add_cmd({"panelMsg": ""}) wsa_server.get_web_instance().add_cmd({"liveState": 0}) diff --git a/core/qa_service.py b/core/qa_service.py index f26ee24..bc8ca40 100644 --- a/core/qa_service.py +++ b/core/qa_service.py @@ -25,7 +25,6 @@ class QAService: ] self.command_keyword = [ - [['播放歌曲', '播放音乐', '唱首歌', '放首歌', '听音乐', '你会唱歌吗', '我想首听歌'], 'playSong'], [['关闭', '再见', '你走吧'], 'stop'], [['静音', '闭嘴', '我想静静'], 'mute'], [['取消静音', '你在哪呢', '你可以说话了'], 'unmute'], @@ -41,7 +40,6 @@ class QAService: answer = self.__get_keyword(answer_dict, text) elif query_type == 'command': answer = self.__get_keyword(self.command_keyword, text) - print(answer) return answer diff --git a/fay_booter.py b/fay_booter.py index aa052ce..b093e06 100644 --- a/fay_booter.py +++ b/fay_booter.py @@ -105,7 +105,7 @@ class DeviceInputListener(Recorder): #recorder会等待stream不为空才开始录音 def get_stream(self): - while self.streamCache is None: + while not feiFei.deviceConnect: time.sleep(1) pass return self.streamCache diff --git a/main.py b/main.py index 109e6a2..99de9c2 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,7 @@ if __name__ == '__main__': web_ws_server = wsa_server.new_web_instance(port=10003) web_ws_server.start_server() #Edit by xszyou in 20230516:增加本地asr后,aliyun调成可选配置 - if config_util.ASR_mode == "ali" and config_util.config['source']['record']['enabled']: + if config_util.ASR_mode == "ali": ali_nls.start() flask_server.start() app = QApplication(sys.argv)