Cookies Setting
We use cookies to improve your browsing experience, analyze traffic, and personalize content. By using this site, you agree to our use of cookies. For more details, please check our Cookie Policy.
Home News

Audio Codecs Explained: G.711, G.722 & More

Audio Codecs Explained: G.711, G.722 & More
2025-07-18 Author: Lennon Page view: 4252

An audio codec, short for audio encoder/decoder, plays a crucial role in modern digital audio systems by converting audio signals between analog and digital formats. It efficiently compresses audio data for transmission or storage, and decompresses it for playback. Audio codecs are widely used in applications like VoIP, streaming, conferencing, and broadcasting, where maintaining high-quality audio while optimizing bandwidth is essential.

 

What Is an Audio Codec?

The term "codec" is a mashup of  COder/DECoder. It's a piece of software or hardware (or both) that performs two essential, often sequential, jobs:

Encoding (Compression): Takes a raw, uncompressed digital audio signal (like a pristine WAV or AIFF file straight from a studio microphone) and compresses it. This drastically reduces the file size by cleverly removing redundant or less perceptually important information.

Decoding (Decompression): Takes the compressed audio file (like an MP3, AAC, or FLAC) and decompresses it back into a form that your speakers or headphones can play. This happens in real-time when you hit "play."



 

Why Do We Need Audio Codecs?

Uncompressed digital audio—for example, CD-quality audio—can produce over 1 Mbps of data per second. For embedded systems and IP networks, this is a huge load.

With appropriate audio codecs, we can:

Reduce data size to save bandwidth

Optimize storage for recordings

Enable real-time transmission, especially important in two-way communication

Enhance audio quality via features like noise suppression or gain control

How Do Audio Codecs Work?

Audio codecs operate at the heart of every digital audio communication system. Their primary task is to convert analog audio signals into compressed digital data for transmission, and then reconstruct the original sound for playback on the receiving side.

Let’s break down this process into stages:

 


1. Analog-to-Digital Conversion (ADC)

A microphone captures sound waves as analog signals. The ADC samples the analog waveform at a specific sampling rate (e.g., 8kHz, 16kHz, 44.1kHz) and converts it into raw digital data (typically in PCM format).

2. Encoding / Compression

The digital audio is passed through a codec's encoder, which applies compression algorithms to reduce file size or transmission bandwidth.

This may involve:

♦ Lossless compression (e.g., G.711 – preserves waveform exactly)
♦ Lossy compression (e.g., Opus, AAC – discards redundant or inaudible data)
♦ The encoded audio is typically wrapped into RTP packets (Real-time Transport Protocol) for real-time streaming.

3. Transmission over Network

The compressed audio packets are transmitted via protocols like:
♦ RTP over UDP: Fast, suitable for real-time voice/video
♦ RTSP, SIP, or Multicast: Depending on the system architecture
♦ Codec efficiency directly impacts bandwidth usage, latency, and audio clarity during transmission.

4. Decoding / Decompression

On the receiving end, the decoder extracts the compressed stream and reconstructs the audio waveform into a playable digital signal. The decoder must match the encoder’s format for successful communication.

5. Digital-to-Analog Conversion (DAC)

Finally, the decoded digital signal is passed to a DAC, which converts it back into analog form to be played through a speaker, headset, or other audio output device. The encoder compresses audio into a compact digital format (often into RTP packets), while the decoder reconstructs it on the receiving side for listening.

Common Audio Codecs and Comparison

Codec Compression Type Bitrate Latency Audio Quality Typical Use Case
G.711 PCM (uncompressed) 64 kbps Low Very clear VoIP, SIP intercom
G.722 ADPCM (wideband) 64 kbps Low High fidelity HD conferencing, broadcast
G.726 ADPCM (compressed) 16–40 kbps Medium Acceptable Legacy systems, limited bandwidth
AAC Lossy compression 32–256 kbps Medium High quality Streaming, IP cameras
MP3 Lossy compression 32–320 kbps Medium Adjustable Media playback, recording
Opus Hybrid/dynamic 6–510 kbps Very low Excellent WebRTC, real-time meetings


Tips:

G.711 offers best compatibility across VoIP/SIP systems
G.722 delivers enhanced voice clarity
Opus is ideal for modern conferencing with low latency and high quality
AAC is widely used in video/audio streaming scenarios

Real Applications of Audio Codecs

IP Public Address System

The diagram below demonstrates a real-time broadcast initiated by the SPON server to an IP speaker.

Based on the packet data captured using Wireshark, it is evident that the MP3 codec is used for audio transmission.

Below are the key advantages of using MP3 codec format in broadcasting environments:

● High Compression Efficiency
MP3 significantly reduces the size of audio files without sacrificing much in audio quality. This is particularly useful in IP broadcasting scenarios, where optimizing bandwidth usage is essential for maintaining stable and synchronized audio streams across multiple endpoints.

● Low Bandwidth Consumption
Compared to uncompressed formats like PCM, MP3 requires much less bandwidth for transmission. This makes it ideal for large-scale deployment where many terminals or speakers need to receive the same audio content over the network simultaneously.

● Wide Compatibility
One of MP3’s biggest strengths lies in its universal compatibility. Almost all modern IP audio devices, media players, and broadcasting systems support MP3 decoding natively, which greatly simplifies system integration and deployment.

● Mature and Stable Technology
As one of the most established audio codecs in the world, MP3 has proven its reliability over decades. Its encoding and decoding algorithms are well-optimized, stable, and widely supported by open-source and commercial software libraries.

● Low Latency Support
When properly configured, MP3 can provide low-latency audio streaming — a critical requirement for real-time public address systems, emergency alerts, and live announcements.

● Efficient Resource Usage
MP3 decoding consumes relatively low CPU and memory resources, making it especially suitable for embedded devices like IP speakers or wall-mounted terminals where system resources are limited.


IP Intercom System

The diagram below demonstrates a real-time intercom initiated by the SPON Windows APP to an IP intercom.

Based on the packet data captured using Wireshark, it is evident that the G.711μ(PCMU) codec is used for audio transmission.

 

Below are the key advantages of using G.711μ codec format in intercom environments:

● Low Latency
Since G.711μ does not require complex compression/decompression, it introduces minimal delay — a key requirement in interactive communication like intercom calls.

● Excellent Speech Clarity
Operating at 64 kbps, G.711μ provides high voice quality suitable for clear person-to-person conversations.

● Lightweight Processing
Encoding and decoding G.711μ requires very little CPU power, making it ideal for embedded devices such as IP intercom panels and network speakers.

● Broad Compatibility
G.711μ is natively supported by SIP-based VoIP systems and most telephony hardware/software, ensuring seamless interoperability between intercom devices and third-party systems like PBXs or NVRs.

● No Licensing Fees
As a standardized and mature codec, G.711μ is royalty-free, reducing cost for manufacturers and users.

How to Choose the Right Audio Codec?

Consideration Recommendation
Network Bandwidth Use lower bitrate codecs (G.726, MP3) if limited
Audio Quality Use Opus, AAC, or G.722 for better clarity
Latency Sensitivity Choose low-latency codecs like G.711 or Opus
System Compatibility G.711 is widely supported in SIP/NVR systems
Device Performance Avoid heavy codecs on low-power hardware


When selecting an audio codec for your system, it’s essential to consider various factors such as bandwidth, audio clarity, latency, compatibility, and device capabilities. The table above summarizes these considerations and provides practical recommendations.

Frequently Asked Questions (FAQ)

Q1: Why are AAC recordings smaller than G.711?
A1: AAC is a lossy format with high compression, while G.711 is uncompressed PCM with larger data size.

Q2: Is G.722 backward-compatible with G.711?
A2: No, they are different codecs. If one side doesn’t support G.722, fallback or transcoding is required.

Q3: Opus is great, so why isn’t it always used?
A3: Opus requires more CPU and memory, which might not be suitable for low-cost embedded systems.

Q4: No sound on SIP call?
A5: Check codec negotiation in SIP INVITE/200 OK messages. Use packet capture tools like Wireshark.

Conclusion

Audio codecs are critical enablers of intelligent, efficient, and scalable audio communication systems. Whether you’re configuring SIP terminals, optimizing a broadcast network, or integrating with an NVR, understanding audio codecs allows you to:

● Improve audio quality
● Reduce latency and network usage
● Avoid compatibility issues
● Make informed decisions when selecting devices

As part of our technical support mission, we are here to help you deploy the right codec strategy tailored to your system needs.