Batch-convert wav to mp3

I found a way to convert a bunch of wav files to mp3 on Windows. Since it took me a while to find this supposedly simple thing, I though I’d share, and also ask if anybody knows how to do the same on a mac.

First, download the Windows version of LAME. You might already have it if you are using Audacity with mp3 files. The LAME folder has a dll file that Audacity uses, but also an exe file, which gives you a command-line interface.

From the command prompt, go to the LAME directory, and try something like:

FOR %X IN (sounds\\*.wav) DO lame %X

Where “sounds” is the path to the directory that has your sound files in it.

What is this good for? If you want to run a web-based questionnaire with sound files, you will find that browsers treat sound files poorly and inconsistently. The best way I know to improve the situation is to use Sound Manager 2, which puts your files inside a little flash object – but it requires your files to be in mp3 format.

13 thoughts on “Batch-convert wav to mp3

  1. kjoonlee

    If you have a command-line version of lame in your path, and a terminal app with a shell, the following will work in OS X, I believe.

    for X in sounds/*.wav; do lame $X ; done

    Due to how wildcards work in the *nix world, you will nave to mention slashes explicitly.

  2. Michael Becker

    Thanks for the tip about LameDropXPd, kjoonlee.

    The missing slash was a typo. I fixed it now.

    So I guess I still don’t know how to get a command-line version of lame for OS X. The mac download directed to from Audacity only gives a library, which I don’t how to use.

  3. kjoonlee

    Hi, you’re welcome :)

    Compiling a command-line executable file of lame is pretty straight-forward if you know how, but some people provide binary versions that they’ve compiled.

    http://www.rarewares.org/mp3-lame-bundle.php

    Please look for “LAME 3.97 release for MacOS X” at RareWares, where rare (or useful!) audio software can be found. :)

  4. Scott Schiller

    On Windows, WinLAME is also a nice GUI frontend for the LAME encoder. I use it regularly – and of course, it does work nicely with SM2, provided you create CBR-based MP3s, anyway. ;)

  5. Free-Loops.com

    Dude thank you so much. i’ve been trying to find something to convert thousands of .wav files to mp3…. as after much searching i find out Flash wont play .wav unless they are loaded into the stage.

    This is the ticket.

    Mike Koenig

  6. Selims

    I needed to convert hundreds of Wav files to mp3 files. I thought that I would have to do them one by one, using itunes or audacity, until I found Max (at http://sbooth.org/Max/ ) with allows for batch conversions. I just set the preferences and let it work over night – the results were perfect.

  7. margus

    This is a very old post, but I’d still thought to comment.
    Batch conversion is Mac OSX is actually very simple with iTunes.
    In preferences, set the CD import settings to MP3, drag your WAV files to iTunes, right click and select “Create MP3 version”.
    Then just drag the files out of iTunes and your done.

Leave a Reply

Your email address will not be published. Required fields are marked *