On Thursday, August 14, 2003, at 11:15 AM, jim smith wrote:


Hello to everyone,

did someone of you know the function ov_read from ogg/vorbis ?
(The main function to decode ogg files).
What is the main function in lame.h to decode a mp3 - file (FILE* mp3file)?
lame_decode(...)?
If so, how can I merge FILE* with this function?



there is no method in lame to decode a complete file.
you have to iterate through your *.mp3 file, get some bytes into
a inputBuffer (here: mp3buf) and let lame decode this buffer with lame_decode().


prototype:
int CDECL lame_decode( unsigned char * mp3buf, int len, short pcm_l[], short pcm_r[] );


see lame.h and /frontend/main.c in the lame-source-project for details.

then write both outputBuffers interleaved to disk.
make that procedure as long as you got no more bytes from the *.mp3-file.
don't forget to write a wav-header at the front of the output-file.


you also have to compile the lame-source with
#define HAVE_MPGLIB     1
for building with MP3 decoding library.


sebastian roll.



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

Reply via email to