Telephony audio converter
Convert a voice prompt, greeting or hold music file to what a PBX, IVR or contact-centre platform plays. Every output is mono, at 8 kHz for a standard call or 16 kHz for a wideband one, and the G.711 encodings match the ITU tables byte for byte.
Output formats
| Format | Contents | Size per minute |
|---|---|---|
| G.711 µ-law WAV | 8 kHz, 8-bit µ-law, WAV format tag 7 | 480 kB |
| G.711 A-law WAV | 8 kHz, 8-bit A-law, WAV format tag 6 | 480 kB |
| 16-bit PCM WAV, 8 kHz | 8 kHz signed 16-bit | 960 kB |
| 16-bit PCM WAV, 16 kHz | 16 kHz signed 16-bit, wideband | 1.92 MB |
.ulaw / .alaw |
The G.711 bytes with no header | 480 kB |
.sln |
8 kHz signed 16-bit little-endian, no header | 960 kB |
.sln16 |
16 kHz signed 16-bit little-endian, no header | 1.92 MB |
A companded WAV carries the 18-byte fmt chunk and a fact chunk with the sample count, which the WAV specification requires of every non-PCM file.
The headerless files say nothing about their own format. The extension is the only label, so keep it: Asterisk reads .sln as 8 kHz and .sln16 as 16 kHz from the name alone.
PCM or G.711
A G.711 file is already in the codec most calls use. The phone system copies its bytes to the line, so nothing is re-encoded and the CPU cost per call is close to zero.
A 16-bit PCM file is uncompressed and twice the size. The phone system encodes it for each call, which lets one recording serve calls on different codecs. Asterisk takes this route for .wav files, and it is the safer upload when the platform’s documentation does not name a codec.
Pick µ-law for North American and Japanese systems and A-law for European and international ones when the platform asks for G.711 by name.
Phone band filter
A narrowband line carries roughly 300 to 3400 Hz. The filter removes what lies outside that range before encoding: a fourth-order high-pass at 300 Hz and a fourth-order low-pass at 3400 Hz. For the 16 kHz outputs the band is 50 Hz to 7 kHz.
Leave it on for voice prompts. Mains hum, desk thumps and plosive rumble sit below 300 Hz, cost headroom, and are inaudible on a handset anyway. Turn it off only when the system applies its own filter and you want the file to hold the full 0 to 4 kHz.
Level
The level setting scales the file so its loudest sample lands on the chosen value, measured after the filter. -3 dBFS is the default. Phone systems add no headroom of their own, and G.711 clips hard above full scale, so a prompt that peaks at 0 dBFS distorts on some handsets.
Peak level is not loudness. Two prompts normalised to the same peak can still differ in how loud they sound if one has a single sharp consonant standing above the rest. Match prompts by ear with Hear the call, or level them first with a loudness tool and choose “Leave the level as it is” here.
Stereo sources
A call has one channel. A stereo file is mixed to mono by averaging left and right. When the two sides hold different material, such as a voice on one side and music on the other, pick left or right instead.
Hear the call
The preview plays the encoded file decoded again, at the output sample rate. That is the audio a caller receives before the handset and the network add their own losses. The second button plays the untouched source, and switching between them keeps the playback position, so one sentence can be compared both ways.
Expect three audible changes: no treble above 4 kHz, less bass, and a faint grain under quiet passages from the 8-bit companding. Music loses more than speech. Hold music with dense cymbals or deep bass turns harsh on a narrowband line whatever the encoder does, so choose sparse arrangements.
Limits
- The source can be up to one hour long.
- G.722, G.729 and GSM 06.10 are not written.
- Resampling to 8 or 16 kHz uses the browser’s audio decoder, which low-pass filters before reducing the rate.
- No dither is added. At 8 bits of companded resolution the codec’s own noise is far above any dither.