Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated using 4PSA automated script
Note

Applies to VoipNow 3.5!

Starting with VoipNow 3.5, it is possible to use sounds at higher quality. Before this latest version, all the sounds from Asterisk were encoded at 8KHz. From now on, all sounds files are updated to higher quality 16 KHz. Such sounds are already available for download here

Step-by-step guide

Getting the sounds

Let's say we want to install a 16KHz French sounds pack recorded by June Wallack, on VoipNow 3.5. For that we need to download the proper archive.

Shell
mkdir /root/french
cd french
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-fr-sln16-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-fr-sln16-current.tar.gz
Extract sounds from both archives and arrange those sounds in the correct format for a sound pack. Basically, all the sounds that are not part of a folder must go to a fr folder that you need to create.
Shell
mkdir fr
mv *.sln16 fr
In all the folders, except the newly created fr,  there must be a fr sub-folder where all the sounds must go. For instance, all the sounds from the dictate folder must go in the fr sub-folder that must be created under dictate. At the end, the directory structure must have the following structure:

Code Block
├── dictate
│   └── fr
├── digits
│   └── fr
├── followme
│   └── fr
├── fr
├── ha
│   └── fr
├── letters
│   └── fr
├── phonetic
│   └── fr
├── silence
│   └── fr
└── wx
    └── fr

Converting to the required format

In order to convert from the slin16 format to wave, we can use soxThe following command converts a sound to the proper format used by Asterisk:

Shell
sox -t raw -r 16k -e signed-integer -b 16 -c 1 <input>.sln16 output.wav
There are a lot of sounds in those folders. Using the following script, all sounds will be converted to the desired format:

Code Block
languagebash
#!/bin/bash
for i in `find /root/french -name '*sln16'`
    do
        final=${i:0:${#i} -6}.wav
        echo sox -t raw -r 16k -e signed-integer -b 16 -c 1 $i $final
        sox -t raw -r 16k -e signed-integer -b 16 -c 1 $i $final
        rm -rf $i
done

Once the sounds are converted, you need to move them to the folder used by Asterisk to store sounds and set the correct owner for those files: 

Shell
cp -Rap * /var/lib/asterisk/sounds/
chown -R asterisk: /var/lib/asterisk/sounds/
At this point, you need to select French as Phone language in the Edit User section.

Down-sampling files the required format

If sounds are recorded in a professional way or with a professional recorder that is not able to record uncompressed wave at 16KHzyou may use the following command to down-sample those files:

Shell
sox sound.wav -e signed-integer -c 1 -b 16 -r 16k sound-down.wav 
For an automated process, the following script will down-sample all the wave files from the /root/sounds folder (assuming they are stored there) to the required format used by Asterisk:

Code Block
languagebash
#!/bin/bash
for i in `find /root/sounds -name '*wav'`
    do
      final=${i:0:${#i} -4}-16k.wav
      echo sox $i -e signed-integer -c 1 -r 16k -b 16 $final
      sox $i -e signed-integer -c 1 -r 16k -b 16 $final
	  rm -rf $i
      mv $final $i
done

Content by Label
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@5d4a10c1
sortmodified
showSpacefalse
reversetrue
typepage
labelsAsterisk sounds VoipNow
cqllabel in ("sounds","asterisk","voipnow") and type = "page" and space = "4PSAKB"

Page properties
hiddentrue
Related issues 

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.