How to convert audio for Asterisk .wav format

In our example we take "sound.mp3" and convert it to .wav.

Generally Asterisk for its wave needs one audio channel (-ac 1) / mono and 8000hz (-ar 8000) instead of the standard CD/MP3 of 44100hz.

Here is the command to convert into Asterisk .wav format:

 ffmpeg -i sound.mp3 -ac 1 -ar 8000 sound.wav

Errors Asterisk may give you if the format is wrong:

    -- Executing [91781891@cme:3] Playback("SIP/234-00000008", "/var/lib/asterisk/sounds/sound") in new stack
[Sep 26 15:45:32] WARNING[4400][C-00000009]: format_wav.c:111 check_header_fmt: Unexpected frequency mismatch 44100 (expecting 8000)
[Sep 26 15:45:32] WARNING[4400][C-00000009]: file.c:510 fn_wrapper: Unable to open format wav
[Sep 26 15:45:32] WARNING[4400][C-00000009]: file.c:1303 ast_streamfile: Unable to open /var/lib/asterisk/sounds/sound (format (ulaw)): No such file or directory
[Sep 26 15:45:32] WARNING[4400][C-00000009]: app_playback.c:513 playback_exec: Playback failed on SIP/234-00000008 for /var/lib/asterisk/sounds/sound
 

    -- Executing [9132131@cme:3] Playback("SIP/234-00000006", "/var/lib/asterisk/sounds/sound") in new stack
[Sep 26 15:44:18] WARNING[4384][C-00000007]: format_wav.c:102 check_header_fmt: Not in mono 2
[Sep 26 15:44:18] WARNING[4384][C-00000007]: file.c:510 fn_wrapper: Unable to open format wav
[Sep 26 15:44:18] WARNING[4384][C-00000007]: file.c:1303 ast_streamfile: Unable to open /var/lib/asterisk/sounds/sound (format (ulaw)): No such file or directory
[Sep 26 15:44:18] WARNING[4384][C-00000007]: app_playback.c:513 playback_exec: Playback failed on SIP/234-00000006 for /var/lib/asterisk/sounds/sound
 


Tags:

convert, audio, asterisk, wav, formatin, quot, mp, generally, ac, mono, hz, ar, format, ffmpeg, errors, executing, cme, playback, sip, var, lib, stack, sep, format_wav, check_header_fmt, frequency, mismatch, fn_wrapper, unable, ast_streamfile, ulaw, directory, app_playback, playback_exec,

Latest Articles

  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -
  • Ubuntu Debian How To Install Recommended Packages Automatically
  • How to set Linux Ubuntu Redhat Debian Command Line http https socks proxy for yum apt
  • How to resize a pdf without losing much quality in Linux Mint Ubuntu Debian Redhat Solution
  • qemu: could not load PC BIOS 'bios-256k.bin' solution
  • Proxmox How To Custom Partition During Install
  • Hyper-V Linux VM Boots to Black Screen, Storage, NIC Not Found Issues
  • Ubuntu Mint How to Fix Missing/Broken /dev and /dev/pts which causes terminal to immediately close exit and not work
  • How high can a Xeon CPU get?