Hi everybody, I'm Simone from Genoa.
I'm using minimad for WinCE, so I had to modify it in some part. Now I believe I've done a good job, because the function "decode" does something... it calls "input" then calls "error". The message I get from "error" is the sequent:
"decoding error 0x0101 at byte offset 0"
Does someone know what does it means (I've understood only that the error happens at the beginning of the file ".mp3", but the code 0x0101 doesn't tell me nothing...)?
Thank you all.
---- Simone
naso wrote:
Hi everybody, I'm Simone from Genoa.
I'm using minimad for WinCE, so I had to modify it in some part. Now I believe I've done a good job, because the function "decode" does something... it calls "input" then calls "error". The message I get from "error" is the sequent:
"decoding error 0x0101 at byte offset 0"
Does someone know what does it means (I've understood only that the error happens at the beginning of the file ".mp3", but the code 0x0101 doesn't tell me nothing...)?
Thank you all.
Simone
In file mad.h you have all the error codes:
MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
I'm quite new to MAD too but I've experienced this one already. You get this error when your input function places other than MPEG Audio frames in the MAD input buffer. I experienced this with some files that had some ID tags in the beginning of the file. I had to find the first frame (frame synchronization) and place *that* in the MAD input buffer. In other words, try to skip the something in the beginning of your file and make sure you always give MAD MPEG Audio frames only.
Someone correct me if I'm wrong.
On Thursday, May 2, 2002, at 07:27 AM, Dado Colussi wrote:
In file mad.h you have all the error codes:
MAD_ERROR_LOSTSYNC = 0x0101, /* lost synchronization */
I'm quite new to MAD too but I've experienced this one already. You get this error when your input function places other than MPEG Audio frames in the MAD input buffer. I experienced this with some files that had some ID tags in the beginning of the file. I had to find the first frame (frame synchronization) and place *that* in the MAD input buffer. In other words, try to skip the something in the beginning of your file and make sure you always give MAD MPEG Audio frames only.
Just to clarify, libmad returns this error whenever it expected to find an MPEG audio sync word (marking the beginning of a frame) but found something else instead. It's mostly an informational error; when you call the decoding routine again it will automatically search for the next sync word in the stream and resynchronize.
There are two cases when libmad expects to find a sync word:
1. After a call to mad_stream_buffer(), a sync word is expected to be found at the beginning of the buffer.
2. After successfully decoding a frame header and calculating the frame's size, another sync word is expected immediately to follow the frame.
When this error is returned, stream->this_frame points to the place in the stream where a sync word was expected.
Usually this error is an indication that something else is in the bitstream, such as an ID3 tag. In this case you might call id3_tag_query() to see if it really is a tag and either read or skip it.
-- Rob Leslie rob@mars.org