Skip to content

Instantly share code, notes, and snippets.

@jimmsta
Created July 23, 2023 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmsta/bfd0f61128e6b221342429c79ff811ab to your computer and use it in GitHub Desktop.
Save jimmsta/bfd0f61128e6b221342429c79ff811ab to your computer and use it in GitHub Desktop.
FreePBX sound file converter cmd script for a folder of wav files - requires ffmpeg in the path
setlocal
@echo off
###############
# version 2.0
# resamples and converts audio files to mono, saves as intermediate wave
# then converts to ulaw.
# for FreePBX-based PBX software
# intended for Asterisk 19+
###############
mkdir intermediates
mkdir ulaw
for %%f in (*.wav) do (
ffmpeg -i "%%f" -ac 1 -ar 8000 "intermediates/%%~nf.wav"
)
echo press key to contine generating uLaw files
for %%f in (intermediates/*.wav) do (
ffmpeg -i "%%f" -f mulaw "ulaw/%%~nf.ulaw"
)
echo Press any key to verify that files were generated
dir intermediates
dir ulaw
pause check that files have been generated and press any key to exit.
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment