Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Lame Batch Convert (Read 4743 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

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..

Ideas?

Thanks!



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.
It's only audiophile if it's inconvenient.