Hi guys,
I've been browsing this forum and I can't find quite the information I need for a project I am working on.
I want to embed an MP3 file splitter into an audio app that I am writing. I found the source for mp3splt-1.9-win32 on SourceForge, and after days of searching for sourcecode, this has been the only app really helpful to me in learning how to do splitting. Although the compiled EXE works fine, it really has too many features, so I decided to spin off and do my own proggie sorta based on it.
I have been reading The Private Life of MP3 Frames and this has been instrumental in my understanding of the structure of a frame. Based on this and previous coding experience I have, I feel I will have no trouble writing my split engine for CBR-encoded files.
On the other hand, VBR-encoded files might give me some trouble. My goal is to split files into clips of a fixed time-length, such as 10 seconds or 15, etc. CBR will be easy; I just look at the headers, do the math to calculate the frame lengths, and hop and skip through the file. Once the number of examined frames add up to the desired time span, copy the data to a standalone MP3 file.
Theoretically, this should also work for VBR right? Maybe not - somewhere in my web surfing (dammit I can't find the page now), I read that some VBR models store data in a "bit reservoir". It's my understanding that this consists of unused space in previous frames, which get filled up with overflow data from the current frame - something like when a WinRAR archive is compressed using its "Solid Archive" setting.
My problem is that this whole Bit Bucket (I've taken to calling it that cuz "reservoir" it too hard to type) would seem to make it impossible to cleanly split a VBR file. This is because the audio data is smeared across multiple frames.
And then there is this "ABR" encoding model, which I did not even know existed until about an hour ago, and I have no idea whatsoever how the frames of these types of files are set up, and what splitting would do to them.
So how does one cleanly split VBR and ABR files?
A better question to ask might be: Can they be cleanly split?
I also read there are a couple of mutually-exclusive additional header data frames from Xing and FHG that contain information about the VBR data. Once I started getting into that I realized this may or may not be information that I needed to know, and decided to look for some help here.
Can anyone shed some light on this for me, or point me to some newbie-to-moderate explanation of correct file splitting techniques....??
Also, something else I have been forced to consider is this idea of "wrapped" files. I am understanding these to be multiple MP3 files that are just all appended together into one larger file, with the ID3 data sandwiched inbetween the smaller files, so that upon examination of the wrapped file, it appears there is ID3 data appearing at various points in the middle of the file, correspoding to where the "seams" between the smaller files are. How in heck do I deal with this...???
Thanks...!