Answer the question
In order to leave comments, you need to log in
How to create and merge audio in golang?
I have 400+ audio files where each is about 3-4 seconds long. And I need to either create an empty audio file of a certain period of time and directly insert my files into it, or combine all these files into one, but with the generation of empty intervals. The question is how to actually implement all this and preferably using Golang
Answer the question
In order to leave comments, you need to log in
If we talk about the implementation on Go - as an option...
1. create a file and encoder like here https://github.com/viert/go-lame
2. read your files in a loop using mp3 decoder, like here https://github.com/hajimehoshi/go-mp3/blob/master/...
and write their contents to the encoder
Where you need emptiness - try to record/generate 1sec or less silence and write it to the encoder when needed.
If the task just needs to be solved and it is not necessary to use Go - it can be solved using the `ffmpeg` console command like this:
ffmpeg file1.mp3 file2.mp3 silence1sec.mp3 silence1sec.mp3 output.mp3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question