Using LAME on fly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using LAME on fly

Orlandi Stefano
Hi,
I am developing an application in VxWorks o.s. (UNIX like platform) using
LAME 3.96.1 to convert CD-DA tracks to MP3 files.
I am currently converting CD-DA tracks to WAV files, before launching LAME.
I compiled and executed LAME 3.96.1 with VxWorks successfully.

For my final application I will have not enough space on Hard Disk to store
WAV files, so I need to convert on fly a CD-DA track to a MP3 file using
LAME (creating the MP3 file step by step, each time passing to LAME <n>
blocks of PCM data frames of 2352 bytes read from CD-DA).

NOTE: I found lame_encode_buffer_interleaved API, which seems the API I
could use.
      I also analized XTracker Windows application, which seems to do the
same things I would like to do, but it uses LAME      
      DLL, while I will work under UNIX like platform. The correspondances
of LAME APIs used seem to be:
            - beInitStream     <---> lame_init
       - beEncodeChunk    <---> lame_encode_buffer_interleaved
            - beDeinitStream   <---> lame_init_params
            - beCloseStream    <---> lame_close
            - beVersion        <---> lame_init
            - beWriteVBRHeader <---> lame_encode_flush
            - beWriteVBRHeader <---> lame_mp3_tags_fid

Is there some sample C/C++ code showing use of LAME to convert a CD-CA track
(PCM data) to MP3 step by step for a UNIX like platform, instead of using
WAV files?

Thanks and regards,
Stefano
_______________________________________________
mp3encoder mailing list
[hidden email]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder
Reply | Threaded
Open this post in threaded view
|

Re: Using LAME on fly

Dmitriy Startsev
Hello, Orlandi!
You wrote to <[hidden email]> on Fri, 20 May 2005 09:12:02
+0200:

 OS> For my final application I will have not enough space on Hard Disk to
 OS> store WAV files, so I need to convert on fly a CD-DA track to a MP3
 OS> file using LAME (creating the MP3 file step by step, each time passing
 OS> to LAME <n> blocks of PCM data frames of 2352 bytes read from CD-DA).

 OS> NOTE: I found lame_encode_buffer_interleaved API, which seems the API I
 OS> could use.
 OS>       I also analized XTracker Windows application, which seems to do
 OS> the same things I would like to do, but it uses LAME
 OS>       DLL, while I will work under UNIX like platform. The
 OS> correspondances of LAME APIs used seem to be:
 OS>      - beInitStream     <---> lame_init
 OS>         - beEncodeChunk    <---> lame_encode_buffer_interleaved
 OS>      - beDeinitStream   <---> lame_init_params
 OS>      - beCloseStream    <---> lame_close
 OS>      - beVersion        <---> lame_init
 OS>      - beWriteVBRHeader <---> lame_encode_flush
 OS>      - beWriteVBRHeader <---> lame_mp3_tags_fid

 OS> Is there some sample C/C++ code showing use of LAME to convert a CD-CA
 OS> track (PCM data) to MP3 step by step for a UNIX like platform, instead
 OS> of using WAV files?

I wrote something like this a while ago. Unfortunately, all the source code
was lost when my HD crashed:(
But it is not that hard to figure out everything just by looking at the
sources of lame front-end, ACM and/or DirectShow wrappers, and lame.h.

With best regards, Dmitriy Startsev.

_______________________________________________
mp3encoder mailing list
[hidden email]
http://minnie.tuhs.org/mailman/listinfo/mp3encoder