Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Batch converts FLAC files to MP3
- ::
- ::
- :: Requires:
- :: Lame - http://lame.sourceforge.net/index.php
- :: FLAC - http://sourceforge.net/projects/flac/
- ::
- :: Usage:
- :: convertFLAC.bat %%LOCATION_OF_FLAC_FILES%%
- ::
- :: eg:
- :: convertFLAC.bat c:\flac
- :: convertFLAC.bat %%USERPROFILE%%\desktop\flac
- ::
- :: Set the FLAC file path below
- ::
- set FLACPROGRAM="c:\program files (x86)\flac\flac.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 %FLACPROGRAM% goto :FLACNOTFOUND
- if not exist %LAMEPROGRAM% goto :LAMENOTFOUND
- set CURRENTLOCATION=%CD%
- set TEMPFILE=%TEMP%\flac_convert_%random%.tmp
- cd /d %SOURCEPATH%
- dir/b %SOURCEPATH%\*.flac > %TEMPFILE%
- for /f "delims=*" %%G in (%TEMPFILE%) do call %FLACPROGRAM% -d "%%G"
- dir/b %SOURCEPATH%\*.wav > %TEMPFILE%
- for /f "delims=*" %%G in (%TEMPFILE%) do call %LAMEPROGRAM% "%%G"
- goto :FINISHED
- :VARNOTDEFINIED
- echo.
- echo Batch convert flac to mp3
- echo.
- echo Requires:
- echo Lame - http://lame.sourceforge.net/index.php
- echo FLAC - http://sourceforge.net/projects/flac/
- echo.
- echo Usage:
- echo convertFLAC.bat %%LOCATION_OF_FLAC_FILES%%
- echo.
- echo eg:
- echo convertFLAC.bat c:\flac
- echo convertFLAC.bat %%USERPROFILE%%\desktop\flac
- echo.
- goto :FINISHED
- :FLACNOTFOUND
- echo.
- echo ERROR FLAC NOT FOUND
- echo.
- echo FLAC was expected at %FLACPROGRAM%
- echo FLAC can be downloaded at http://sourceforge.net/projects/flac/
- echo Download and install FLAC.
- 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