From 68919732db984ac2be50af39ba1aaa650e13cc6a Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Wed, 18 Jun 2025 16:44:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/llm_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/llm_service.go b/service/llm_service.go index e340bde..6b31dc3 100644 --- a/service/llm_service.go +++ b/service/llm_service.go @@ -617,10 +617,10 @@ func (s *LLMService) TrimAudioSilence(audioData string) (string, error) { bytesPerSample := int(fmtChunk.BitsPerSample) / 8 // 优化后的静音检测参数 - silenceThreshold := 0.005 // 降低静音阈值,更敏感地检测声音 + silenceThreshold := 0.01 // 降低静音阈值,更敏感地检测声音 windowSize := int(float64(fmtChunk.SampleRate) * 0.05) // 50ms滑动窗口 minSilenceDuration := int(float64(fmtChunk.SampleRate) * 0.1) // 100ms最小静音持续时间 - bufferSamples := int(float64(fmtChunk.SampleRate) * 0.05) // 减少缓冲区到50ms + bufferSamples := int(float64(fmtChunk.SampleRate) * 0.1) // 减少缓冲区到50ms // 计算RMS能量的辅助函数 calculateRMS := func(startSample, endSample int) float64 {