I've done a bunch of work towards making LAME more modular. (in CVS)
In particular, it should now possible to use libmp3lame.a in other
applications without having to construct a simulated argument list and
then calling lame_parse_args().
Unfortunaly, this will probably break other programs that
include lame source. I think the Dll/BladeEncDll.c code should still
work, but this is an example where a Albert had to do a lot
of work constructing a argument list to pass to lame_parse_args().
It could now be simplified and the paramters set directly.
General outline of the API: (see main.c)
gf=lame_init(no_write,no_read)
called before encoding a file
Set no_write=1 if you want to do your file output
Set no_read=1 if you want to do your own file input
returns gf pointer to lame_global_flags struct.
sets gf->* variables to default values
lame_parse_args(int, char **)
called to set encoding options (gf->*), and input
and output filenames. You can ignore this routine
and set all desired encoding options yourself
(but this has never been tested!)
lame_init_params() Initialize based on set encoding options
while not eof:
out=lame_readframe(inBuffer) input one frame of data
out=lame_encodeframe(inBuffer,outBuffer) encode one frame of data
lame_cleanup(outBuffer) close files, flush buffers
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )