mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 17:43:55 +08:00
update:优化配置及文档
This commit is contained in:
@@ -21,8 +21,15 @@ class VADProvider(VADProviderBase):
|
||||
(get_speech_timestamps, _, _, _, _) = self.utils
|
||||
|
||||
self.decoder = opuslib_next.Decoder(16000, 1)
|
||||
self.vad_threshold = float(config.get("threshold", 0.5))
|
||||
self.silence_threshold_ms = int(config.get("min_silence_duration_ms", 1000))
|
||||
|
||||
# 处理空字符串的情况
|
||||
threshold = config.get("threshold", "0.5")
|
||||
min_silence_duration_ms = config.get("min_silence_duration_ms", "1000")
|
||||
|
||||
self.vad_threshold = float(threshold) if threshold else 0.5
|
||||
self.silence_threshold_ms = (
|
||||
int(min_silence_duration_ms) if min_silence_duration_ms else 1000
|
||||
)
|
||||
|
||||
def is_vad(self, conn, opus_packet):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user