This commit is contained in:
RafaelEdwards 2024-11-19 15:48:59 -03:00
parent 3a8356f5fa
commit ead2e11b5f

View File

@ -82,6 +82,8 @@ func convertAudio(inputData []byte, format string) ([]byte, int, error) {
switch format {
case "mp3":
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-f", "mp3", "pipe:1")
case "wav":
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-f", "wav", "pipe:1")
default:
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-ac", "1", "-ar", "16000", "-c:a", "libopus", "-f", "ogg", "pipe:1")
}