Still hoping for some help on this one - and hoping that the right person just hasn't read it yet.
To clarify a little more, there is a GOOD reason I would want to do this: It would (in strong but unproven theory!) facilitate truly gapless playback on CD-based MP3 players. Really.
The reason the MP3 files should wind up a multiple of 2048 bytes is similar to the reason you need WAV files to be a multiple of 2352 bytes. On an audio CD, if the WAV is shorter than that sector size, the remaining space in the sector is filled up with zeroes - which results in silence (or if it's not properly padded with silence, will result in a click/pop). Now, on a data CD, the sector size starts as 2352 bytes as well... but 304 of those bytes are used for error checking, and accurate sector location. That leaves 2048 "user bytes" for storing data. If a file is smaller than 2048 bytes, or if its total size is slightly less than a multiple of 2048 bytes, the file still occupies that sector and nothing else can reside there. The next file on the disc will begin in the next sequential sector, even if it would have fit entirely within the already-partially-filled one. Why? Well, this keeps the Table of contents clean and enables a system to locate data files accurately. Only one file may occupy a physical sector, and that's a hard-and-fast rule.
This presents a slight difficulty for all existing CD-based MP3 players (that I am aware of, at least; I own a RioVolt SP-250 and have verified this on other brands as well). Once the player reaches the end of a compressed audio file, and if the file is shorter than the 2048 bytes of user data within the sector, the read laser must phisically re-locate to the next sector. This results in an audible gap - even between songs that were encoded "gaplessly." And when the songs must flow from one to the next in order to sound right, that's a major distraction. (Think in terms of live recordings, jam sessions, multi-movement orchestral pieces, radio shows...)
By removing any necessity for the laser to stop and locate the next sector (that is, by making sure each sector is completely full and contiguous with its successor), this difficulty should be eliminated.
My earlier assumption that this would involve the addition or removal of a maximum 1024 padding bytes was based on the assumption that the file already contained some padding bytes; I must amend that here. If an audio file was encoded with NO padding, this would result in a maximum addition of 2047 padding bytes (... since the original file would already be either the correct size - requiring no padding - or slightly over). Either way, the only manner I know to currently modify files in such a manner would be to open them in a Hex editor, physically change the necessary number of padding bits (within the frame header) and add the same number of padding bytes to the appropriate frames. That would require a few thousand changes per file, and while I'm patient I'm not necessarily THAT patient. Especially since I have a few thousand hours of live recordings.
Any help would be sincerely appreciated. Please. I can see that this post is being read, so if anyone else would like to see the idea developed please respond so the right person (preferably someone both familiar with the MPEG spec and a skilled programmer) will also recognize the need for such a program.
- M.