mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +01:00
Merge pull request #1557 from xinnan-tech/py_fix_logger
fix: logger中vad和asr动态变化
This commit is contained in:
commit
25ccf7fed3
2 changed files with 9 additions and 0 deletions
|
|
@ -114,6 +114,7 @@ def update_module_string(selected_module_str):
|
||||||
current_module = logger._core.extra["selected_module"]
|
current_module = logger._core.extra["selected_module"]
|
||||||
|
|
||||||
if current_module == selected_module_str:
|
if current_module == selected_module_str:
|
||||||
|
logger.debug(f"组件未更改无需更新")
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -424,6 +424,14 @@ class ConnectionHandler:
|
||||||
init_vad = check_vad_update(self.common_config, private_config)
|
init_vad = check_vad_update(self.common_config, private_config)
|
||||||
init_asr = check_asr_update(self.common_config, private_config)
|
init_asr = check_asr_update(self.common_config, private_config)
|
||||||
|
|
||||||
|
if init_vad:
|
||||||
|
self.config["selected_module"]["VAD"] = private_config["selected_module"][
|
||||||
|
"VAD"
|
||||||
|
]
|
||||||
|
if init_asr:
|
||||||
|
self.config["selected_module"]["ASR"] = private_config["selected_module"][
|
||||||
|
"ASR"
|
||||||
|
]
|
||||||
if private_config.get("TTS", None) is not None:
|
if private_config.get("TTS", None) is not None:
|
||||||
init_tts = True
|
init_tts = True
|
||||||
self.config["TTS"] = private_config["TTS"]
|
self.config["TTS"] = private_config["TTS"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue