MP3 Frames, Splitting, VBR, and the Bit Bucket
Reply #8 – 2003-10-01 10:57:20
To properly split, you have to put data relevant to the current frame but stored in previous frame back into the current frame. To do this, you should first increase the size of the current frame. Ok now... Thanks Gabriel! That gave me what I needed to know for the next step in understanding this! I just thought of something that would clarify the problem: What I think actually needs to happen is that any data in the bit buckets of the current frame AND previous frames that contains data for upcoming frames needs to be removed or ignored . In essence, I need to "wind things down" in preparation for the cut. Once the bit bucket data for upcoming frames is identified and removed from the current AND previous frames, and after those frames are properly resized, cut the file at the end of the current frame. Then - I think - this would qualify as a clean cut, yes? So... 1) How do I identify bit bucket data for upcoming frames? (also - is the bit bucket really used for anything else but upcoming frames?) 2) Once the appropriate data is identified, how do I remove it and properly resize the frames - or - how do I ignore it when copying the rest of the data to construct the ending frames in the new MP3 file...? I am figuring that depending on how many frames the data is smeared across, I will have to process multiple frames to complete the process of "winding down". Keep in mind I am not looking for source code (unless someone just happens to have some they want to show me), but the actual math behind this process which I describe. For instance, what bytes in the header contain the information about the bit bucket, and what format is it in? What multiplcation factors need to be used to calculate sizes of things...? Is it big-endian or little-endian and all that... I understand the basic stuff such as FrameSize = 144 * BitRate / SampleRate , but what I will need to know is the equations to analyze and manipulate the bit bucket so I can remove or ignore that data. Thanks guys! Damn! I never thought I'd find a forum where people would know the answers to this kind of stuff...!!! You guys rock! B)