Hi Jim,
used to work on mpeg audio a lot a while back and out of curiosity took a look at the file you posted.
First of all , is this an error occurring on a lot of files or is it a rare problem?
Some random testing follows…
(1) Checking the file with a frame analyzer (e.g. GitHub - Sjord/checkmate: Checkmate MP3 Checker is a free program that checks MP3 files for errors.), reports it as “broken”, here’s the cli tool report output
mpck-0.21.exe beastie_boys__intergalactic_.mp3
SUMMARY: beastie_boys__intergalactic_.mp3
version MPEG v1.0
layer 3
average bitrate 139333 bps (VBR)
samplerate 48000 Hz
frames 7882
time 3:09.168
unidentified 1745 b (0%)
errors unidentified bytes
inconsistent frame headers
invalid header values
CRC error
result Bad
This can be due to some headers not having correct values , or to the file implementing some edge cases of the mpeg standard that the decoder has no valid implementation for.
(2) On the other hand Opened the same file with Adobe Audition and it did not flinch an eye … even tough lots of products that manage mpeg audio may have a more “liberal” approach
e.g. read the first header and if the bitrate is constant assume all following frames never change.
(3) then tried to set up some kind of workaround e.g. decodec and reencode, using lame, and got this, which at first sight tells me this file is really problematic: lame is a very mature player in the mpeg audio player space, even tough again this is up a lot ot how “liberal” the encoder is.
C:\Users\Michelangelo\Downloads>lame --decode beastie_boys__intergalactic_.mp3
input: beastie_boys__intergalactic_.mp3
(48 kHz, 2 channels, MPEG-1 Layer II)
output: beastie_boys__intergalactic_.wav (16 bit, Microsoft WAVE)
skipping initial 241 samples (encoder+decoder delay)
Frame# 2/2864 384 kbps L R ihip: bitstream problem, resyncing skipping 18227 bytes...
Frame# 3/2864 32 kbps LMSR Ihip: bitstream problem, resyncing skipping 22264 bytes...
Frame# 4/2864 112 kbps hip: bitstream problem, resyncing skipping 5965 bytes...
Frame# 5/2864 320 kbps hip: bitstream problem, resyncing skipping 9842 bytes...
Frame# 6/2864 256 kbps hip: bitstream problem, resyncing skipping 30882 bytes...
Frame# 7/2864 160 kbps hip: bitstream problem, resyncing skipping 72 bytes...
Frame# 8/2864 320 kbps LMSR hip: bitstream problem, resyncing skipping 13497 bytes...
Frame# 9/2864 56 kbps hip: bitstream problem, resyncing skipping 28027 bytes...
Frame# 10/2864 48 kbps LMSR ihip: bitstream problem, resyncing skipping 12844 bytes...
Frame# 11/2864 80 kbps LMSR Ihip: bitstream problem, resyncing skipping 3287 bytes...
Frame# 12/2864 112 kbps LMSR ihip: bitstream problem, resyncing skipping 24884 bytes...
Frame# 13/2864 160 kbps hip: bitstream problem, resyncing skipping 8820 bytes...
Frame# 14/2864 96 kbps LMSR hip: bitstream problem, resyncing skipping 5946 bytes...
Frame# 15/2864 320 kbps hip: bitstream problem, resyncing skipping 10177 bytes...
Frame# 16/2864 112 kbps L R ihip: bitstream problem, resyncing skipping 4010 bytes...
Frame# 17/2864 112 kbps LMSR ihip: bitstream problem, resyncing skipping 8245 bytes...
Frame# 18/2864 64 kbps hip: bitstream problem, resyncing skipping 23357 bytes...
Frame# 19/2864 96 kbps L R hip: bitstream problem, resyncing skipping 327 bytes...
Error: sample frequency has changed in MP3 file - not supported
(4) doing some more research, one decoder that seems to play friendly with the file is madplay (it’s open source so it would be possible to dive deep and see how it’s taking info out of this file without failing like juce decoder or lame decoder):
windows version here : RareWares - Other MP3 and MP2 encoders and decoders
[Conclusion] (while you wait for Juce fix)
in case this error is a lone error, my advice is to decode it / reencode it by hand
command line to generate a wav file:
madplay.exe beastie_boys__intergalactic_.mp3 -o wave:beastieboys_mad_decode.wav
then re-encode with lame
lame beastieboys_mad_decode.wav
which creates a beastieboys_mad_decode.mp3 file that now is playable by juce demorunner
On the other side, if you get a ton of errors like this one, you could setup a check+re-encoding process in a win or linux cloud machine using some combination of the mp3 checker above || a juce CLI decoder test || lame || madplay || ffmpeg || whatever cli tool you can get your hands on…
Of course in this case you’d run the risk of publishing audio which is formally correct but has glitches or errors of whatever nature, so you have to measure the benefit/cost ratio of this.