Is MP3 mixing possible?
For 2 mp3 streams, is it possible to mix two streams of same bitrate with different mixdown values without uncompressing and recompressing i开发者_高级运维t?
For example, if we have two songs that are already encoded in mp3 192 kbit, and we want to create crossfade of length 5 seconds, we should mix last several frames from one song with same number of frames from the second song, with mix rates increasing from 0 to 100 for entering song and from 100 to 0 for closing one.
From what I know, the mp3-compression goes VERY ROUGHLY something like this:
- takes a frame of samples
- converts them to frequency range
- drops frequencies which are below a certain threshold (which is the compression)
So if you only have the mp3-data, you should have chunks/frames of frequencies (with index). To mix the streams you'd have to take the corresponding frames from each stream and construct a new frame that e.g. consist of f(idx) = fA(idx) + fB(idx) /2. Be aware that the frames have different lengths, because not all indices (idx) are present, which is because some frequencies are drop for the compression. I hope that helps for the beginning. I'm aware that this is not a full on solution.
精彩评论