I need to create a mp3 file with certain number of seconds of silence?
What would be way to do it programatically?
Edit: It doesn't need to be re inserted in mp3, just a single mp3 file that contain silence x seconds long.
I need to create a mp3 file with certain number of seconds of silence?
What would be way to do it programatically?
Edit: It doesn't need to be re inserted in mp3, just a single mp3 file that contain silence x seconds long.
Encode a very short (~40ms) wave file of silence and put the resulting mp3 block as array in your source code. That block may be encoded at 32kbit (which is the least possible bitrate iirc).
Alternatively you would have to link against any mp3 encoding library (i.e. LAME) and feed silence to that to output the result.
Do you just want an MP3 of X seconds long that is just silence, or do you want to inject silence into an existing MP3?
This is a bit more complicated. Windows XP by default has a low quality MPEG encoding codec installed. You can find some informant about encoding to an MP3 with Delphi on that same page if you scroll to the bottom there is information on Wave files. Some of the links are broken though.
It is a two step process, you need to generate a waveform and then encode that waveform to an MP3 file. MP3 files have a header and blocks, so you can't just loop a 40ms mp3 a few times.