Search code examples
audiobatch-filelame

Batch convert all subfolders and files of wav to mp3 using lame


I'd like to convert all WAV files in a specified folder into MP3 and store in the same directory structure, We have a several list of folders and subfolders named by date where these WAV recordings are stored.

I got up until the point thanks to related posts however unable to cross the file extension issue

for /r %i in (*) do if exist "%i.wav" do lame %i %i.mp3

I'm still learning scripting. I'm using Windows XP

Any help would be appreciated


Solution

  • to use this in batch file you'll need double %.

    Here's one more way:

    for /f "delims=" %%F in ('dir /b /s /a:-d *.wav') do (
     lame "%%F" "%%~dpnF.mp3"
    )