Glossary · Telephony & India rules
What are μ-law and A-law in phone audio?
μ-law and A-law (8 kHz phone audio)
μ-law and A-law are the two standard ways phone networks squeeze voice into one byte per sample, defined in ITU-T G.711. A phone call carries 8,000 of those samples every second.
On a call
Your voice bot's TTS returns crisp 48 kHz audio. The phone line wants 8 kHz μ-law. Ask the TTS for ulaw_8000 directly and you skip a resample and a conversion on every sentence of the call.
AI agents from ₹1 a minute.¹
Explained
Here is how it works, in plain words.
Ordinary phone calls sound the way they do because of a standard from 1972. ITU-T G.711 samples the voice 8,000 times a second. Each sample is stored in 8 bits. That works out to 64 kilobits a second in each direction, and it’s still what most phone lines and SIP trunks carry today.
Eight bits is not much. Spread evenly, they’d make quiet speech sound grainy. So G.711 spaces its steps unevenly: fine near silence, coarse for loud sounds. That trick is called companding, and there are two versions of it. μ-law is used mainly in North America and Japan, and A-law in most other countries. They sound almost the same. They’re not interchangeable.
The 8 kHz rate also limits what you hear. A phone line keeps the band people need to understand speech and drops the rest, which is why “s” and “f” can blur on a call and why you spell names out.
For a voice bot, three things follow.
Ask your TTS for the line’s format. Generating 48 kHz audio and converting it yourself costs CPU time on every sentence. It also adds a place for bugs.
Watch the bandwidth. Full-rate PCM needs twelve times the bandwidth of μ-law. A server running many calls at once can fall behind real time on the bigger format, and callers hear the voice break up.
Never guess the format of raw audio. μ-law has no header. Play μ-law as PCM, or narrowband audio at the wrong rate, and you get static or a chipmunk voice. Read the format your provider reports and set the player to match.
Wideband calls exist too, at 16 kHz, on some VoIP and app-to-app routes. The idea is the same, with more room for the voice.
In Voice Infra
This is what Voice Infra does about it.
Mira TTS can send raw μ-law or A-law at 8 kHz, streamed as it's made, so the audio goes onto a phone line with no conversion on your side. Every response says its own rate and encoding in headers, so your code never has to guess. The Realtime API takes the same formats in and out, which saves you two resamples.