vad参数调整 2835/1 2835/head
authorhcj <1224667075@qq.com>
Mon, 1 Dec 2025 06:41:37 +0000 (14:41 +0800)
committerhcj <1224667075@qq.com>
Mon, 1 Dec 2025 06:41:37 +0000 (14:41 +0800)
code/sdk/zhihui/imsl/src/vad_server.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c

index 6b1f9f7..f684714 100644 (file)
@@ -424,7 +424,7 @@ errcode_t vad_server_init(vad_status_callback_t callback)
     struct VadConfig vad_config = {
         .vad_log_level = 1,                   /* INFO 日志 */
         .sil_threshold = 63,                  /* 静音阈值 */
-        .energy_threshold = 50000,            /* 能量阈值 */
+        .energy_threshold = 40000,            /* 能量阈值 */
         .min_speech_length = 240,             /* 最短语音长度 (ms) */
         .silence_detect_length = 300,         /* 静音检测长度 (ms) */
         .rule1_min_tailing_silence = 480,     /* 规则1静音时间 (ms) */
index a17e9a2..41a1680 100644 (file)
@@ -197,7 +197,7 @@ static uint32_t g_audio_timeout_ticks = 1500; // 音频超时tick数(默认1.5
 static uint32_t g_last_binary_data_tick = 0;  // 最后一次接收二进制数据的tick
 
 // 音频数据最近缓存(环形缓冲区,仅保留最近数据)
-#define AUDIO_CACHE_BUFFER_SIZE  (1024+512)  // 8KB缓存
+#define AUDIO_CACHE_BUFFER_SIZE  (1024*3)  // 8KB缓存
 static uint8_t g_audio_cache_buffer[AUDIO_CACHE_BUFFER_SIZE];
 static uint32_t g_audio_cache_pos = 0;  // 当前写入位置
 static uint32_t g_audio_cache_total = 0;  // 总写入数据量