Bulk Convert Batch file for converting to 8K


@echo off

: Gerard O'Rourke
: Michael Brophy
: Version 1.1


:::::: UPDATE BELOW to the CORRECT FOLDER NAME :::::::
set SOX-FOLDER=C:\Program Files (x86)\sox-14-4-1\
set PATH=%PATH%;%SOX-FOLDER%

cls

set confirm=N
echo *************************************
echo Converting tool - to 8K Sampling Rate
echo *************************************
echo echo Download sox from http://sox.sourceforge.net/
echo ******************************************************************
echo. 
set /P confirm=Do you want to proceed and overwrite and convert existing.wav files to 8K Sampling Rate (Y/N)?

IF "%confirm%" == "Y" goto convert
IF "%confirm%" == "y" goto convert
goto noconvert


:convert
echo Converting files now.
echo please wait.....
echo.
FOR /R . %%i IN ("*.wav") DO (
sox "%%i" -r 8000 -c 1 "%%~pni-temp.wav"
move "%%~pni-temp.wav" "%%~pni.wav" 1> NUL
echo "%%i"
)

echo.
echo Completed.

pause
exit

:noconvert
echo No converation took place
pause
exit
  • tech-notes/scripts/convert-to-8k.txt
  • Last modified: 2018/05/17 20:05
  • by gerardorourke