Click here to Skip to main content
15,998,782 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I need help using lame. I have a bunch of files that I have in wav format and would like all to be converted from wav to mp3. I have no idea on how to use lame.exe at all.

Can someone please give me code snippets or help in anyway possible.
Posted

You need to 'shell out' to LAME to do the encoding. This means that LAME will run out of process in its own process.

I'm not familiar with the command line arguments of the encoder, but you will need to String.Format them, and then pass them to Process.Start().

Again, consult the documentation but you can hide the process so it doesn't show up in its own window and wait for it to exit if you want to call synchronously.
 
Share this answer
 
lame.exe being an executable accepting arguments, you have to:
- open a command line
- cd to the directory where lame.exe resides
- type lame /? to get a list of possible switches to use with the program

Once you have these switches, then you have to write down the one that you will need to encode your .wav files with the parameters you want.

Then, when you want to launch it from C#, you have to use the Process class, as indicated by Rob Philpott in Solution 1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900