Skip to content

Commit

Permalink
20230719
Browse files Browse the repository at this point in the history
1、修复远程语音不识别问题;
2、修复asr时有不灵问题;
3、去除唱歌指令;
  • Loading branch information
xszyou committed Jul 19, 2023
1 parent 5d4bac2 commit fb8caf7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions core/fay_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ def __get_answer(self, interleaver, text):
#指令
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})
Expand Down
2 changes: 0 additions & 2 deletions core/qa_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self):
]

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


Expand Down
2 changes: 1 addition & 1 deletion fay_booter.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def on_speaking(self, text):

#recorder会等待stream不为空才开始录音
def get_stream(self):
while self.streamCache is None:
while not feiFei.deviceConnect:
time.sleep(1)
pass
return self.streamCache
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __clear_songs():
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)
Expand Down

0 comments on commit fb8caf7

Please sign in to comment.