Note

  1. f → each file that matches *.pcm - "f“ → the full filename (e.g. input.pcm)
  2. ~nf → just the name without extension (e.g. input) - "~nf.wav” → builds the output filename with .wav
: Gerard O'Rourke
: Michael Brophy
: Version 1.1

@echo off
cls

set confirm=N
echo ***************************
echo Audio ALAW Converting tool
echo ***************************
echo The sox.exe must be located in the current folder or on the OS PATH.
echo Download sox from http://sox.sourceforge.net/
echo ******************************************************************
echo. 
set /P confirm=Do you want to proceed - this will create a new file with convert the *.pcm files into *.wav alaw format(Y/N)?

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


:convert
echo Converting files now.
echo please wait.....
echo.
FOR %%f IN (*.pcm) DO (
sox -t raw -r 8000 -e a-law -b 8 -c 1 %%f %%~nf.wav
)

pause
:exit

:noconvert
echo No converation took place
pause
exit
  • tech-notes/scripts/convert-raw-alaw.txt
  • Last modified: 2025/09/15 11:08
  • by gerardorourke