Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 10 wav-Files. I want to convert all of them into mp3-Files. I managed to to this for one single file (as described in How to convert media using VLC?), but I don't want to do this for every single file. Is there a way to convert all the 10 files at a single blow? I'm using windows 7.

share|improve this question
2  
possible duplicate of Batch convert .wav to mp3 and ogg? – nixda Jul 8 '13 at 16:16
    
Thank you for the batch hint! – Ergodicity Jul 9 '13 at 11:26
up vote 10 down vote accepted

I followed nixda's suggestion and used a batch script. I figured out how to programm a batch for windows 7. This is my solution:

@echo off
for /f "delims=|" %%f in ('dir /b C:\Any_Directory\*.wav') do (
echo converting      %%f
CALL "C:\Program Files\VideoLAN\VLC\vlc.exe" --intf dummy --dummy-quiet "%%f" --sout="#transcode{acodec=mp3,ab=256,vcodec=dummy}:standard{access=file,mux=raw,dst=MP3_Files/"%%f"}"  vlc://quit
move "%%f" WAV_converted/"%%f"
)

cd MP3_Files
ren *.wav *.mp3
cd ..

echo .
echo .
echo .
echo conversion finished
pause

How the programm works:

  • All the files with the .wav extension in the specified folder "C:\Any_Directory\" are converted to mp3 (the file names must not contain any whitespaces)
  • The mp3 files are saved in the folder "MP3_Files" (which must already exist)
  • The wav files are pushed to the folder "WAV_converted" (which must already exist)
  • "ab=256" sets the bit rate. To convert with e.g. bit rate 128, replace it with "ab=128".
  • The batch file must be run from the same folder as the files you want to convert ( as mentioned by Kevin Heidt )

Hints - Remove "--intf dummy --dummy-quiet" from the script if you want to see the VLC GUI while converting. Could be useful for debugging.

Update There ist still one bug: If the name of the wav-file contains a dot or comma, the name is truncated (and no extension is appended!). The file gets converted despite this. Tested with Version 1.1.11. Newer versions may not work!

Added quote sign: --sout="...". Works for newer Versions, too. Tested with Version 2.1.3 64-bit on Windows (see the VLC wiki page for differences in command line for Linux and Windows and additional examples and options).

share|improve this answer
1  
+1 Good & new solution – nixda Jul 16 '13 at 7:41
1  
Note: this assumes your batch file is being run from the same folder as the files you want to convert (D:\"folder xyz"\VLC_batch) – Kevin Heidt Sep 16 '15 at 17:40
    
excellent stuff. – roel Oct 7 '15 at 7:30
1  
videolan link is dead... – Kev Mar 24 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .