I'm getting a couple of error messages while using the mpglib
to decode MP3 data using the libmp3lame
library environment.
error(#1): hip: Can't rewind stream by 74 bits!
error(#2): hip: bitstream problem, resyncing skipping 10 bytes...
Note: the "resyncing" message says 10 bytes which is 74 bits rounded up: (74 + 7) / 8 = 10
.
My MP3 decoder code follows the code in the LAME frontend tool (mainly frontend/lame_main.c and frontend/get_audio.c).
The header generates no errors and I use up to 100 bytes as per the frontend tool (see the lame_decode_initfile()
function in the get_audio.c
file.) I even tried to read data one byte at a time while handling the header to see whether it would make a difference and... not really.
The error happens when I start passing the MP3 data after having parsed the header.
Any idea why I would be getting these error messages?
P.S. when I decode using the lame command line tool, I do not get the error.
$ lame --verbose --decode test.mp3 test-lame.wav
input: test.mp3 (44.1 kHz, 2 channels, MPEG-1 Layer III)
output: test-lame.wav (16 bit, Microsoft WAVE)
skipping initial 529 samples (encoder+decoder delay)
Frame# 87426/88167 168 kbps MS
Although there seem to be a discrepancy between the number of frames but I would imagine that's because the 88167 was an estimation and not a known number of samples.