20230719
1、修复远程语音不识别问题; 2、修复asr时有不灵问题; 3、去除唱歌指令;
This commit is contained in:
parent
5d4bac29b8
commit
fb8caf7645
@ -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})
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
2
main.py
2
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)
|
||||
|
Loading…
Reference in New Issue
Block a user