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) */
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; // 总写入数据量