Here are some more possibilities:

1. mp3 file is corrupt.  try lame --decode input.mp3  
   and see if it works okay.
2. you didn't call lame_decode_init() to initialize decoder
3. you are decoding more than one file at a time within the 
   same executable.  (unlike LAME's encoding library, mpglib is not re-entrant)
4. bugs in our code.  but it has been used in 'lame --decode' for years.
5. bugs in your code.



> 
> That helps but the problem is I give it 196608 bytes of the mp3 file and it 
> still returns 0.
> 
> I dont know whats not working ...
> 
> Thanks
> -Mat
> 
> On Sunday 12 May 2002 13:19, you wrote:
> > > Hi,
> > >   I dont know if this is the right mailing list for such a question the
> > > mailing list link on the lame homepage links to a file so I dont know...
> > >   Im using the lame interface to decode mp3s. But whenever I call
> > > lame_decode it returns 0, meaning according to the header file that it
> > > needs more data, Im wondering how much data I should give it ?? What is
> > > an ideal size for the mp3buffer?
> > >   And while we're at it could someone tell me what the len param is for?
> > > The size of the pcm buffer or the size of the mp3 buffer?
> > >
> > > Thanks
> > > -Mat
> > > --
> > > Mathieu Dube -- [EMAIL PROTECTED]
> > > 8D Technologies Inc.
> > > http://www.8d.com
> >
> > Hi Mat,
> >
> > I'm not sure what the optimal size is, but I would guess the larger
> > the better.  The lame frontend decoder (which is far from optimal)
> > feeds the decoder a few bytes at a time until the header is parsed,
> > and after that calls lame_decode with 1K bytes of data.
> >
> > I see the documentation in lame.h for 'lame_decode_*()' functions is
> > pretty sparse.  I added this, which should answer your questions:
> >
> >
> > /*********************************************************************
> >  * input 1 mp3 frame, output (maybe) pcm data.
> >  *
> >  *  nout = lame_decode(mp3buf,len,pcm_l,pcm_r);
> >  *
> >  * input:
> >  *    len          :  number of bytes of mp3 data in mp3buf
> >  *    mp3buf[len]  :  mp3 data to be decoded
> >  *
> >  * output:
> >  *    nout:  -1    : decoding error
> >  *            0    : need more data before we can complete the decode
> >  *           >0    : returned 'nout' samples worth of data in pcm_l,pcm_r
> >  *    pcm_l[nout]  : left channel data
> >  *    pcm_r[nout]  : right channel data
> >  *
> >  *********************************************************************/

_______________________________________________
mp3encoder mailing list
[EMAIL PROTECTED]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder

Reply via email to