#82 Separate beginning silence from audible portion


Of all the mp3 files from various encoders that I have encountered, LAME is the only encoder that seems to encode beginning silence in a way that combines it with the audible portion so that it cannot be removed. Some of the files have nearly a second of silence, which can be very noticeable and annoying. Attempts to remove this silence by removing frames from the beginning of the file corrupt the audible portion so that a chirp or squawk is usually produced. Encoding beginning silence in separate frames would allow it to be trimmed by users who find it problematic. (This characteristic may apply more to VBR encodings than CBR.)


  • Mike Brown
    Mike Brown

    As I posted in reply to you on the Hydrogenaudio forums, without testing it myself, I'll go out on a limb and say this is likely a result of the use of the bit reservoir, a standard feature of the MP3 format, and one that LAME makes use of by default because it helps with quality.

    Keep in mind that MP3s are not really designed to be cut on frame boundaries, because each frame depends partly on adjacent frames, and the psychoacoustic model creates dependencies across multiple frames. The inter-frame dependency exists even if the bit reservoir isn't used, so any trimming almost always results in some kind of problems, even if often inaudible or ignored by players.

    However, if you minimize use of the bit reservoir, either by encoding with the --nores option, or repacking (expanding) your files with mp3packer -b 320, I anticipate you will be able to cut on frame boundaries with your favorite trimmer/cutter app and be reasonably assured of having no audible seams. You can then use mp3packer -z to repack the file as tightly as possible.

    Barring that, please provide more info, like a sample file, the LAME version, and what player you're using.