Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Batch converts WMA files to MP3
- ::
- ::
- :: Requires:
- :: Lame - http://lame.sourceforge.net/index.php
- :: MPlayer - http://www.mplayerhq.hu
- ::
- :: Usage:
- :: convertWMA.bat %%LOCATION_OF_WMA_FILES%%
- ::
- :: eg:
- :: convertWMA.bat c:\WMA
- :: convertWMA.bat %%USERPROFILE%%\desktop\wma
- ::
- :: Set the MPLAYER file path below
- ::
- set MPLAYERPROGRAM="c:\program files (x86)\mplayer\mplayer.exe"
- ::
- :: set the LAME file path below
- ::
- set LAMEPROGRAM="c:\program files (x86)\lame for audacity\lame.exe"
- ::
- :: +-----------------------------+
- :: | DO NOT EDIT BELOW THIS LINE |
- :: +-----------------------------+
- ::
- if [%1]==[] goto :VARNOTDEFINIED
- if [%1] NEQ [] set SOURCEPATH=%1
- if not exist %MPLAYERPROGRAM% goto :MPLAYERNOTFOUND
- if not exist %LAMEPROGRAM% goto :LAMENOTFOUND
- set CURRENTLOCATION=%CD%
- set TEMPFILE=%TEMP%\wma_convert_%random%.tmp
- cd /d %SOURCEPATH%
- dir/b %SOURCEPATH%\*.wma > %TEMPFILE%
- for /f "delims=*" %%G in (%TEMPFILE%) do call %MPLAYERPROGRAM% -vo null -vc dummy -af resample=44100 -ao pcm:file="%%G.wav" "%%G"
- dir/b %SOURCEPATH%\*.wav > %TEMPFILE%
- for /f "delims=*" %%G in (%TEMPFILE%) do call %LAMEPROGRAM% "%%G"
- goto :FINISHED
- :VARNOTDEFINIED
- echo.
- echo Batch convert wma to mp3
- echo.
- echo Requires:
- echo Lame - http://lame.sourceforge.net/index.php
- echo MPlayer - http://www.mplayerhq.hu
- echo.
- echo Usage:
- echo convertWMA.bat %%LOCATION_OF_WMA_FILES%%
- echo.
- echo eg:
- echo convertWMA.bat c:\wma
- echo convertWMA.bat %%USERPROFILE%%\desktop\wma
- echo.
- goto :FINISHED
- :MPLAYERNOTFOUND
- echo.
- echo ERROR MPLAYER NOT FOUND
- echo.
- echo MPLAYER was expected at %MPLAYERPROGRAM%
- echo MPLAYER can be downloaded at http://www.mplayerhq.hu
- echo Download and install MPLAYER.
- echo Edit the batch file and update the path.
- echo.
- goto :FINISHED
- :LAMENOTFOUND
- echo.
- echo ERROR LAME NOT FOUND
- echo.
- echo LAME was expected at %LAMEPROGRAM%
- echo LAME can be downloaded at http://lame.sourceforge.net/index.php
- echo Download and install LAME.
- echo Edit the batch file and update the path.
- echo.
- goto :FINISHED
- :FINISHED
- erase %TEMPFILE%
- cd /d %CURRENTLOCATION%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement