voice function support qwen mod
This commit is contained in:
1 parent
505bb43bf0
commit
ed4a49c8ae
1 file changed
+11
-2
+11
-2
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user