mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 03:53:55 +08:00
Merge pull request #1557 from xinnan-tech/py_fix_logger
fix: logger中vad和asr动态变化
This commit is contained in:
@@ -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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user