tags:

views:

729

answers:

2

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.

+1  A: 

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.

bothie
+2  A: 

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.

Jim McKeeth
I just need to get single file with x seconds of silence, I am not re inserting it / or re encoding it.Thanks.
Irfan Mulic
Then you need to generate a waveform of silence and encode it with that link I provided. You can call the codec built into XP or bundle one with your application. BTW, be aware that there is licensing fees for using MP3's in your application.
Jim McKeeth
I couldn't find anything on that site links are broken?!
Irfan Mulic
What is it will all these broken links. The world is falling apart.
Jim McKeeth
All the other pages I have found are broken or missing too.
Jim McKeeth