How to prevent lame from cutting the spectrum?
Reply #54 – 2014-10-02 17:46:33
FWIW, lossyWAV can only affect the noise level in the high-end, which is likely to be essentially invisible on a spectrogram. I never filters frequencies out of the audio, just reduces the bit-depth smartly so should look essentially identical on a spectrogram. The -X setting even achieves less than 320 kbps typically. Regarding the OP, I understand most of what you want. I think you want MP3 for the utmost in compatibility, you want LAME to encode it for about the best quality and perhaps for gapless support, yet desptie its inaudibility you also want a spectrogram that looks like the original CD's for some warm fuzzies in your heart and will accept the potential for harming audio quality slightly in rare circumstances in return. Essentially, you want to retain the high-frequencies coarsely but to waste relatively few bits on encoding them as they are inaudible and don't need to be accurately reproduced. No developer is likely to modify the psychoacoustic model to provide this purely visual feature to an MP3 encoder unless they have a "business case" for it in attempting to sell it to gullible audiophools. The way to reduce bit-wastage on high frequencies in LAME is to use the -Y switch (search the Knowledgebase Wiki). This still allows accurate encoding of 0-16kHz material which is what matters to the sound in almost all real music. It allows the psychoacoustic model to represent the higher frequencies much more coarsely, which should be inaudible in the vast majority of real music, thereby avoiding the huge waste of bits normally required, but it will just lower the precision, which will rarely cause holes in the spectrogram or a visible change in spectrogram intensity or colour. Test this setting: lame -V 0 -Y --lowpass 22.05 and see how it "looks". (or 22.5 maybe, if allowed) Also, there were changes to the VBR algorithm in LAME 3.98 / 3.99 / 3.100 so you could try LAME 3.97 which is also a very good encoder just in case it might not be quite as clever at omitting inaudible high frequencies when available bitrate is restrictive and thus cause dips in the visible spectrogram. Doing this will hopefully only degrade sound quality significantly on really hard problem samples - maybe fatboy (Kalifornia) and few others where 320kbps bitrate is too limiting and will otherwise just cause higher bitrates in exchange.