Quantcast
Channel: VOIP-info.org Wiki Changes
Viewing all articles
Browse latest Browse all 5767

Using ffmpeg to convert to Asterisk Native SLN

$
0
0
Asterisk's Native SLN audio format (1.2 and up) is "raw" or headerless "wav" format, little endian 16-bit signed PCM a.k.a. signed linear (hence SLN). While it seems that SoX or Audacity should be able to convert to this format, neither seems to be able to write little-endian 16-bit PCM.

ffmpeg, one of the best swiss-army-knife-type audio/video conversion programs, specifically supports signed 16-bit little-endian PCM. To convert just about any audio (anything ffmpeg can handle) to the appropriate format for Asterisk music-on-hold:

ffmpeg -i "[input file]" -ar 8000 -ac 1 -acodec pcm_s16le -f s16le "[output file].sln"

You may also want to add a volume modifier, to make the music appropriately quiet for music-on-hold, and ffmpeg allows this to be specified in dB gain like "-vol -15dB".

See also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Viewing all articles
Browse latest Browse all 5767

Trending Articles