Hi there,
I had the same problem. The way I fixed it was to feed the MAD decoder with 1 second audio chucks that starting with the ADTS (Audio Data Transport Stream) sync word (0xFFFC).
I'm not a MPEG1 specialist but, if I remember well, every second, over the 37 audio chunks, an ADTS header is injected. That header is always starting with the sync word: 0xFFFC.
Therefore, if you provide the MAD decoder with 1 second audio chunk (starting with the ADTS header) you should avoid the lost of synchronization problem.
Regards
Bruno
-----Message d'origine----- De : mad-dev-bounces@lists.mars.org [mailto:mad-dev-bounces@lists.mars.org] De la part de a19617@ualg.pt Envoyé : 27 novembre 2005 16:39 À : mad-dev@lists.mars.org Objet : [mad-dev] Decodding error
hi there... :) I've using libmad, and I want to decode a mp3 file, but I get the following decoding errors.
this example is for a very small mp3.
decoding error 0x0101 (lost synchronization) at byte offset 0 decoding error 0x0102 (reserved header layer value) at byte offset 67 decoding error 0x0101 (lost synchronization) at byte offset 85 decoding error 0x0101 (lost synchronization) at byte offset 104
but most of the times I get the following, this example is for another mp3 file,
decoding error 0x0101 (lost synchronization) at byte offset 0 decoding error 0x0101 (lost synchronization) at byte offset 6034865
it seems that I get errors at the begin and at the end of the offsets.
Should I worry with this ? I does it happen? If someone could help me.. ;)
thanks...
Sónia Gonçalves