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".
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ
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
- Converting to Asterisk Native SLN Audio with ffmpeg
- MusicOnHold Configuration
- Asterisk cmd SetMusicOnHold
- Asterisk cmd MusicOnHold
- Asterisk cmd MP3Player
- Using ffmpeg to convert Music On Hold files Convert to WAV and u-Law PCM in one step using ffmpeg
- Using Slimserver for Music on Hold: How to use a local or remote slimserver for your Music on Hold
- Asterisk MOH Uploader - convert and upload MP3 using Charozt
- Configuration
- Sound files
- Convert sln to mp3
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ