mirror of
https://github.com/EvolutionAPI/evolution-audio-converter.git
synced 2025-07-13 15:14:50 -06:00
opus codec
This commit is contained in:
parent
a0d446204f
commit
0a14e6b2db
9
main.go
9
main.go
@ -85,14 +85,7 @@ func convertAudio(inputData []byte, inputFormat string, outputFormat string) ([]
|
||||
case "wav":
|
||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-f", "wav", "pipe:1")
|
||||
default:
|
||||
if inputFormat == "webm" {
|
||||
// Custom settings for webm to ogg conversion
|
||||
fmt.Println("Conversão de webm para ogg")
|
||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-acodec", "libopus", "-b:a", "16k", "-vbr", "on", "-compression_level", "10", "-ac", "1", "-ar", "16000", "-f", "ogg", "pipe:1")
|
||||
} else {
|
||||
// Default settings for other formats to ogg
|
||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-acodec", "libopus", "-ac", "1", "-ar", "16000", "-f", "ogg", "pipe:1")
|
||||
}
|
||||
cmd = exec.Command("ffmpeg", "-i", "pipe:0", "-c:a", "libopus", "-b:a", "16k", "-vbr", "on", "-compression_level", "10", "-ac", "1", "-ar", "16000", "-f", "ogg", "pipe:1")
|
||||
}
|
||||
outBuffer := bufferPool.Get().(*bytes.Buffer)
|
||||
errBuffer := bufferPool.Get().(*bytes.Buffer)
|
||||
|
Loading…
Reference in New Issue
Block a user