1、修复远程语音不识别问题;
2、修复asr时有不灵问题;
3、去除唱歌指令;
This commit is contained in:
xszyou 2023-07-19 22:45:03 +08:00
parent 5d4bac29b8
commit fb8caf7645
4 changed files with 3 additions and 8 deletions

View File

@ -164,10 +164,7 @@ class FeiFei:
#指令 #指令
keyword = qa_service.question('command',text) keyword = qa_service.question('command',text)
if keyword is not None: if keyword is not None:
if keyword == "playSong": if keyword == "stop":
MyThread(target=self.__play_song).start()
wsa_server.get_web_instance().add_cmd({"panelMsg": ""})
elif keyword == "stop":
fay_booter.stop() fay_booter.stop()
wsa_server.get_web_instance().add_cmd({"panelMsg": ""}) wsa_server.get_web_instance().add_cmd({"panelMsg": ""})
wsa_server.get_web_instance().add_cmd({"liveState": 0}) wsa_server.get_web_instance().add_cmd({"liveState": 0})

View File

@ -25,7 +25,6 @@ class QAService:
] ]
self.command_keyword = [ self.command_keyword = [
[['播放歌曲', '播放音乐', '唱首歌', '放首歌', '听音乐', '你会唱歌吗', '我想首听歌'], 'playSong'],
[['关闭', '再见', '你走吧'], 'stop'], [['关闭', '再见', '你走吧'], 'stop'],
[['静音', '闭嘴', '我想静静'], 'mute'], [['静音', '闭嘴', '我想静静'], 'mute'],
[['取消静音', '你在哪呢', '你可以说话了'], 'unmute'], [['取消静音', '你在哪呢', '你可以说话了'], 'unmute'],
@ -41,7 +40,6 @@ class QAService:
answer = self.__get_keyword(answer_dict, text) answer = self.__get_keyword(answer_dict, text)
elif query_type == 'command': elif query_type == 'command':
answer = self.__get_keyword(self.command_keyword, text) answer = self.__get_keyword(self.command_keyword, text)
print(answer)
return answer return answer

View File

@ -105,7 +105,7 @@ class DeviceInputListener(Recorder):
#recorder会等待stream不为空才开始录音 #recorder会等待stream不为空才开始录音
def get_stream(self): def get_stream(self):
while self.streamCache is None: while not feiFei.deviceConnect:
time.sleep(1) time.sleep(1)
pass pass
return self.streamCache return self.streamCache

View File

@ -44,7 +44,7 @@ if __name__ == '__main__':
web_ws_server = wsa_server.new_web_instance(port=10003) web_ws_server = wsa_server.new_web_instance(port=10003)
web_ws_server.start_server() web_ws_server.start_server()
#Edit by xszyou in 20230516:增加本地asr后aliyun调成可选配置 #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() ali_nls.start()
flask_server.start() flask_server.start()
app = QApplication(sys.argv) app = QApplication(sys.argv)