Skip to content

thatrex/asterisk-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asterisk Apps

Important

Basic terminal and PBX management skills are assumed.

Extensible apps for asterisk: Talk BotMusic Player

Conversion Script

This script will convert common AV files (mp3, wav, flac, webm, mkv, mp4) to Mono 8kHz PCM WAV files suitable for Asterisk. Converted files will be placed in a subdirectory named processed.

  1. Ensure FFmpeg is installed on your system.
  2. Open your terminal, then navigate to the directory containing the audio files to be converted.
  3. Copy and paste the script into your PowerShell terminal.

PowerShell

The text being red is not of concern.

$OPATH = 'processed'
$TYPES = 'mp3', 'wav', 'flac', 'webm', 'mkv', 'mp4'

New-Item $OPATH -Type Directory -Force

$TYPES `
| ForEach-Object { Get-ChildItem "*.$_" } `
| ForEach-Object -Parallel {
    $OFILE = Join-Path $using:OPATH ($_.BaseName + '.wav')
    & ffmpeg -i $_.Name -ar 8000 -ac 1 -acodec pcm_s16le $OFILE # -map_metadata -1
} -ThrottleLimit 4

About

Apps for asterisk!

Topics

Resources

Stars

Watchers

Forks

Contributors