remote
Aug 23 2007, 17:48
Hi all,
I need to pad out an mp3 file to a particular size, but I'm not sure if there would be restrictions on how I could do this.. I'm guessing it's not as easy as padding out a .wav, I can't just add zeroes on the end. Would I have to do it by adding fake data (such as valid mp3 headers, with zeroes for data), or could I pad it's size out with some kind of additional tag, like an ID3 tag or something?? (or do ID3 tags always live at the start of the file?)
Only just started working with mp3s, so sorry if this is really obvious!
(oh, and I'd prefer to pad out the mp3, rather than pad out the source wav before encoding.. I'm not just trying to be awkward though, honest!)
Thanks for any help,
Eddie
ID3V1 tags go at the end of the file but they are fixed length, so this does you no good.
ID3V2 tags are variable length but they go at the front of the file. What you could probably do is encode the file, see how much you need to increase its length, and then use some tagging software to add a ID3V2 tag to take up the extra space.
Alternatively you could first encode with Lame, see how much you need to add, and then encode a second time with Lame, adding the proper switch this time to reserve the needed space for ID3V2 tags.
QUOTE (remote @ Aug 23 2007, 08:48)

Hi all,
I need to pad out an mp3 file to a particular size, but I'm not sure if there would be restrictions on how I could do this..
MP3Trim will add space (i.e. timed amounts of silence) to the beginning and end of mp3's as well as trim them. You mention that you want to pad a file out to a particular size (rather than to a designated length) so I can't tell you how much filesize data a second of silence will add to any given MP3. It has to do with the bit rate: a second of silence at 320 KBS will add more data than a second at 128 KBS.
BobO
From the way the question was posed I hadn't even considered that you might be asking how to increase the play time. Is that what you meant?
remote
Aug 24 2007, 16:30
Thanks for the replies.
I don't want to change the playback time, I just want the file to be a certain size. The method I'm trying out now is to use the ID3v2 Tag.. From what I've read, all I need to do is add a valid header, and can then add as much padding as I like before the actual mp3 data. (ok, there is a limit, but it's very big, 256Mb)
So, I'm just starting the file off with "ID3", then the version number and revision, 0 for the flags, and then the size of the header (as a synchsafe int.. took me a minute to get my head round that bit). All seems to be working well so far..
Eddie
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.