Important
Basic terminal and PBX management skills are assumed.
Extensible apps for asterisk: Talk Bot • Music Player
This script will convert any MP3, WAV or FLAC files to Mono 8kHz PCM WAV files suitable for Asterisk. Converted files will be placed in a subdirectory named converted
.
- Ensure FFmpeg is installed on your system.
- Open your terminal, then navigate to the directory containing the audio files to be converted.
- Copy and paste the appropriate script for your OS into your terminal.
$output = "converted"
New-Item -Path $output -ItemType Directory -Force
Get-ChildItem | where {$_.extension -in ".mp3",".wav",".flac"} | ForEach-Object {
$name = "$output/$($_.BaseName).wav"
& ffmpeg -i $_.Name -ar 8000 -ac 1 -acodec pcm_s16le -f wav $name
}