Asterisk itself can transcode many audio formats such as g722, alaw and ulaw to name a few. However the Asterisk is unable to convert many files into HTML5 compatible audio types. What is an "HTML5 compatible audio file". Before HTML5, there was no standard for playing audio files on a web page. Before HTML5, audio files could only be played with a plug-in (like quicktime). With HTML5 audio files are able to be played back natively in your browser!
Great! So generate the HTML5 files for me
Unfortunately every browser supports a different format of audio file. We can't just generate a wav file and expect all browsers to understand it. Here is a quick list of the different formats supported by different browsers:
|Browser||Operating system||Formats supported by different web browsers|
|WAV PCM||MP3||MP4 AAC||ADTS AAC||Ogg Vorbis||WebMVorbis||Ogg Opus||WebM Opus|
|Google Chrome||All supported||Yes||Yes||Yes||Yes||9||Yes||25|
(since v31 in Windows)
|Mozilla Firefox||All supported||3.5||OS-dependent[a]||OS-dependent[a]||No||3.5||4.0||15.0||28.0|
|Safari||OS X||3.1||3.1||Yes||Yes||Manual install||No||No||No|
Ok. So can you generate the different formats?
This is where the fun begins. Unfortunately due to licensing and legalities we are not able to distribute anything that makes MP3 or MP4 (M4A) files. However it's not illegal for you to compile the binaries for these programs yourself.
So what do I have to do?
There are different options for different types of files. After looking at the table above you need to decide what you want to support. After the libraries have been installed FreePBX will automatically detect them and use them to create files.
WAV files can be generated through either Asterisk itself or through SOX. In nearly all distributions you can download and install SOX through rpm repositories (yum install sox or apt-get install sox)
OGG/OGA files can be generated through SOX. You can download and install SOX through rpm repositories (yum install sox or apt-get install sox)
MP3 files are usually generated through a program called LAME. There are several install guides for LAME online. A good starting point would be: http://lame.sourceforge.net/
MP4/M4A files are usually generated through a program called FFMPEG. There are several install guides for FFMPEG online. A good starting point would be: https://www.ffmpeg.org/