Upgrade 3CX to v18 and get it hosted free!

Using ffmpeg to convert to Asterisk Native SLN

Author image

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

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.