Projects‎ > ‎Cmd && Bash Scripts‎ > ‎

CMD::Convert a directory containing wavs into mp3 using vlc

posted Apr 23, 2011, 5:01 PM by Chairman Steve   [ updated Apr 23, 2011, 8:32 PM ]
You must have VLC added to your paths environment variable for this to work. File names cannot contain apostrophe ( ' ) character.

@rem transcode_wav_dir.bat
@rem Usage: convert a dir of wavs into mp3 using vlc

@echo off
SET filename=^"^"
FOR /F "tokens=*" %%G IN ('dir /b *.wav') DO (call :s_do_convert "%%G")
GOTO :end

:s_do_convert
 SET filename=%1
 ECHO %filename%
 vlc %filename% --no-sout-video --sout "#transcode{acodec=mp3}:std{access=file,mux=raw,dst='%filename:~1,-5%.mp3'}"
 GOTO :eof

:end
 PAUSE