Skip to main content

Topic: Lame Batch Convert (Read 2121 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Kam1073
  • [*]
Lame Batch Convert
Hello everyone!

I need a little help to write a simple batch file that can do the following:

Convert any .wav files in a directory to mp3 using the original file name and delete the original .wav file when complete.

This directory will always have a .wav file that is recording, so when the script hits the "file in use" error, it needs to skip it and move on.

I plan to take the batch file and have windows run it automatically on an hourly schedule.

My original plan was to run: C:\filepath\lame.exe" --preset cbr 256 d:\filepath\*.wav

But Lame will only encode a single file and then exit. 

Also not sure how to delete the original .wav file when complete..



  • Kohlrabi
  • [*][*][*][*][*]
  • Global Moderator
Lame Batch Convert
Reply #1
Try this:

Create a file called encode_and_delete_wav.bat, open it in an editor and add the following:
Code: [Select]
for /R %%f in (*.wav) do (
"C:\filepath\lame.exe" --preset cbr 256 "%%f" "%%~dpnf.mp3"
del %%f

Deploy the file into the folder where the WAV files reside, or edit the parameter *.wav describing the set, accordingly. I'm not sure whether it will skip the WAV file being written to, try it.
  • Last Edit: 23 July, 2012, 07:01:01 PM by Kohlrabi
It's only audiophile if it's inconvenient.