voice function support qwen mod

This commit is contained in:
wujian committed 2026-03-06 19:31:06 +08:00
1 parent 505bb43bf0
commit ed4a49c8ae
1 file changed
+11 -2
+11 -2
View File
@@ -207,8 +207,17 @@ func ConvertAudioToMP3(audio []byte, srcFormat string) ([]byte, error) {
return nil, fmt.Errorf("ffmpeg not found in PATH: install ffmpeg to enable voice message support")
}
var cmd *exec.Cmd
if srcFormat == "amr" || srcFormat == "silk" {
cmd := exec.Command(ffmpegPath,
"-i", "pipe:0",
"-f", srcFormat,
"-f", "mp3",
"-ac", "1",
"-ar", "16000",
"-y",
"pipe:1",
)
// For formats where ffmpeg can't auto-detect from pipe, specify input format
if srcFormat == "amr" || srcFormat == "silk" {
cmd = exec.Command(ffmpegPath,
"-f", srcFormat,
"-i", "pipe:0",