feat: mp4 convert

This commit is contained in:
Davidson Gomes 2024-11-13 18:25:37 -03:00
parent 3a8356f5fa
commit 8f44a21fc4
2 changed files with 4 additions and 0 deletions

2
docker_build.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker buildx build --platform linux/amd64,linux/arm64 -t atendai/evolution-audio-converter:latest --push .

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 "mp4":
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-c:a", "aac", "-f", "mp4", "pipe:1")
default:
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-ac", "1", "-ar", "16000", "-c:a", "libopus", "-f", "ogg", "pipe:1")
}