mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
在不增加额外配置的情况下进行优化
This commit is contained in:
@@ -430,9 +430,9 @@ class ConnectionHandler:
|
||||
def _initialize_voiceprint(self):
|
||||
"""为当前连接初始化声纹识别"""
|
||||
try:
|
||||
voiceprint_enable = self.config.get("voiceprint", {}).get("enable", False)
|
||||
if voiceprint_enable:
|
||||
voiceprint_provider = VoiceprintProvider(self.config.get("voiceprint", {}))
|
||||
voiceprint_config = self.config.get("voiceprint", {})
|
||||
if voiceprint_config:
|
||||
voiceprint_provider = VoiceprintProvider(voiceprint_config)
|
||||
if voiceprint_provider is not None and voiceprint_provider.enabled:
|
||||
self.voiceprint_provider = voiceprint_provider
|
||||
self.logger.bind(tag=TAG).info("声纹识别功能已在连接时动态启用")
|
||||
|
||||
Reference in New Issue
Block a user