Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
Lame Batch Convert, Simple Batch Convert Command
post Jul 23 2012, 20:13
Post #1

Group: Members
Posts: 1
Joined: 23-July 12
Member No.: 101679

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



Go to the top of the page
+Quote Post
post Jul 23 2012, 23:59
Post #2

Group: Super Moderator
Posts: 1289
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561

Try this:

Create a file called encode_and_delete_wav.bat, open it in an editor and add the following:
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.

This post has been edited by Kohlrabi: Jul 24 2012, 00:01

It's only audiophile if it's inconvenient.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 25th November 2015 - 00:20