VoIP communication is facilitated by a technology called codecs, which compress a speaker’s audio sounds into data for transmission across the internet.
However, not all Voice over Internet Protocol codecs are the same–some focus on low latency, some prioritize low bandwidth, and some transmit a wide range of sound frequencies.
In this article, we’ll take a deep look at VoIP codecs, discussing what they are, how they work for voice calls and conferencing calls, codec variants, and how to choose the right codec for your business communication needs.
What Are VoIP Codecs?
A VoIP codec is a hardware or software-based technology that compresses and transmits an audio signal between devices, enabling rapid and clear communication.
The word “codec” itself combines the technology’s two primary actions–code and decode an analog audio signal into or from a digital one.
There are hundreds of different types of codecs that compress all sorts of media–video, music, streaming, etc.
VoIP codecs are designed to efficiently transmit high-definition, high-quality audio and speech, a critical component of Voice Over IP (VoIP) telephony.
Business VoIP telephony uses a combination of both:
- Hardware codecs: Physical chips in any device that records, transmits, or plays audio and video. Computers, tablets, cell phones, headsets, and VoIP phones (IP phones) all contain codecs.
- Software codecs: Cloud-hosted PBX providers offer software-based apps featuring codecs, which transmit a digital audio signal across the provider’s telephony network. All video and audio-based programs utilize built-in software codecs, available for download online.
Why Are VoIP Codecs Important?
VoIP codecs are important because they determine VoIP audio quality. Cloud-based business VoIP depends upon real-time digital audio transmission, which enables HD-voice audio quality and eliminates distractions like jitter and latency.
This instantaneous data transmission requires a codec to rapidly convert the analog audio signal into a digital one, retaining as much of the original audio as possible while minimizing the demand for network bandwidth. If a codec requires too much bandwidth or compresses the analog signal too slowly, you may experience audio delay or distorted sound. (The A-law algorithm for North America and Japan reduces speech ranges to ensure efficient encoding.)
How VoIP Codecs Work
A VoIP codec works by receiving one speaker’s audio input, coding this analog audio signal into a digital audio signal, transmitting this digital signal across a VoIP telephony network, then finally decoding the digital signal back into analog on the receiver’s end, where it comes through as clear audio. Remarkably, codecs achieve this whole process in a few hundred milliseconds, enabling real-time VoIP conversations.
Here’s how VoIP codecs work in a cloud-based phone system:
- A VoIP codec receives a speaker’s analog audio signal
- VoIP Codec compresses the analog signal into digital audio-data packets
- The caller’s VoIP provider transmits these digital audio data packets across its VoIP network
- The recipient’s VoIP provider receives the digital data and directs it to the recipient’s app and device
Step 1: VoIP Codec Receives the Speaker’s Analog Audio Signal
When the speaker utters a speech sound into their device, the device’s hardware codecs capture the audio frequency as an analog signal.
Real-life sounds occupy a wide range of audio frequencies. Most speech falls between 80 to 300 Hz, while other noises like musical sounds can range from 20 to over 15,000 Hz. Regular audio codecs capture just a limited portion of real-life audio sounds, which is why phone conversations never sound as clear as in-person interactions.
A higher-quality codec captures a wider frequency range, leading to HD audio that emulates real-life conversation.
Step 2: VoIP Codec Compresses the Analog Signal into Digital Audio-Data Packets
Next, your VoIP application’s codec compresses the analog audio signal into digital data packets (the encoding process). Digital packets require much less bandwidth and transport more easily across the internet.
The compressed audio data’s quality depends on three factors: frequency, sample rate, and bitrate.
- Frequency: The audio sound range that the digital data captures, in Hz. Wideband and super-wideband audio frequencies capture a wider sound range compared with narrowband frequencies. However, wideband audio requires more bandwidth and therefore can be slower and more taxing on a WiFi or Internet network.
- Sample rate: The rate at which the codec can take “snapshots” of audio and transmit them. Measured in samples per second, a higher sample rate means that the codec catches more microseconds of audio, delivering a more seamless and analog-like product to the recipient.
- Bitrate: The amount of digital data contained in each audio sample converted from analog (compression ratio.) Bitrate and sample rate go hand in hand–bitrate being the quality of the compressed audio data, and sample rate being the quantity or speed at which data gets compressed and sent.
Each VoIP codec format–such as G.711, G.722, or Opus–offers a distinct frequency, sample rate, and bitrate.
Therefore, your VoIP software’s codec determines the call audio quality, including the amount of jitter and latency you experience.
Step 3: Caller’s VoIP Provider Transmits Data Across the Network
Once your VoIP codec compresses analog to digital data, your VoIP provider transmits this data across its Internet-based telephony network.
Most VoIP providers utilize multiple global data centers, which can route audio data from caller to receiver in milliseconds, leading to a steady flow of near-instantaneous communication.
Step 4: Recipient’s VoIP Provider Receives Data and Transmits to User’s App or Device
After Internet transmission, the audio data reaches the recipient’s VoIP provider network, where the VoIP software’s codec decodes the data back into an analog signal (the decompression process). This uncompressed signal is then sent to the recipient’s device.
Within a VoIP conversation, all parties must use the same codec–like the G.722, G.711, or Opus–so the involved VoIP providers negotiate the highest-quality mutually supported codec format.
The same process occurs if a party uses mobile or PSTN, both of which are compatible with the G.711 codec.
The Types of VoIP Codecs
While there are dozens of audio codec formats–including the popular mp3–there are only five VoIP codecs commonly used today: G.711, G.722, G.722.2, G.729, and Opus.
VoIP providers typically support several of these codecs, and each format offers distinct benefits: transmission speed, bandwidth usage, audio signal frequency, sample rate, bitrate, and overall audio quality.
According to the International Telecommunications Union (ITU), the most popular VoIP Codecs are:
- G.711: Supported by nearly all VoIP providers, the G.711 format is considered the best codec for interacting with the PSTN landline network. It has a high bitrate, which leads to good sound quality but requires a large amount of bandwidth. A narrowband codec, G.711 supports limited frequencies between 300-3,400 Hz.
- G.722: This wideband codec offers a high bitrate with high bandwidth requirements, and it supports from 50-7000 Hz–capable of HD voice
- G.722.2 (AMR-WB): This wideband VoIP codec has the ability to shift between a 48, 56, or 64 Kbps bitrate, depending on how much bandwidth the telephone network has available
- G.729: G.729 offers narrowband sound quality with a low bitrate–just 8 Kbps. The low bitrate means this codec consumes the least bandwidth of any on this list, making it a great option for teams with many users sharing the same network.
- Opus: An ultra-wideband codec, Opus supports from 50-20,000 Hz along with a remarkably high sample rate. This codec is also flexible, with a bitrate ranging from 6-510 Kbps and bandwidth that adapts to network availability. Opus is a royalty-free, open source codec with no licensing fees.
Codec | Frequency Signal | Sample rate (samples per second) | Bitrate | Latency | Best For |
G.711 | 300-3400 Hz, narrowband | 8,000 samples per second | 64 Kbps | 125 µs | Communication between VoIP and PSTN |
G.722 | 50-7000 H, wideband | 16,000 samples per second | 32 Kbps | 4 ms | Good voice quality with low latency |
G.722.2 (AMR-WB) | 50-7000 Hz, wideband | 16,000 samples per second | 48-64 Kbps | 25 ms | Compromise between voice quality and flexible bandwidth |
G.729 | 300-3400 Hz, narrowband | 8,000 samples per second | 8 Kbps | 15 ms | Low bandwidth usage |
Opus | 50-20,000 Hz, ultra-wideband | Up to 48000 samples per second | 6-510 Kbps | 26.5 ms | HD voice and clear sound |
How to Choose the Right VoIP Codec
The best VoIP codec is the one that fits with your telecom provider’s system, provides optimal sound quality, and meets your bandwidth needs. However, in order for a VoIP call to occur, both parties need to use the same codec.
Most SIP and VoIP software supports multiple codecs and automatically selects the best one for each call, so you don’t need to choose one codec. When choosing a VoIP provider, look for one that offers G.711, G.722, and the Opus codec. These three codecs will guarantee that each call you make optimizes call quality and connectivity.
FAQs
Below, we've answered the top VoIP codec FAQs.