{"id":1015,"date":"2026-05-08T09:45:58","date_gmt":"2026-05-08T02:45:58","guid":{"rendered":"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/"},"modified":"2026-05-08T09:46:27","modified_gmt":"2026-05-08T02:46:27","slug":"what-is-audio-codec","status":"publish","type":"post","link":"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/","title":{"rendered":"What Is an Audio Codec? How It Works, Types, and Best Codec for Streaming"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">13<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><p>Every podcast, music stream, video call, and Bluetooth playback you hear today passes through an audio codec. Without one, a three-minute song would weigh in at roughly 30 MB, and a single hour of stereo audio would chew through more than 600 MB of bandwidth. So <strong>what is an audio codec<\/strong>, and why does it matter to anyone building or shipping a streaming product?<\/p>\n<p>In short, an audio codec is the algorithm (or chip) that compresses raw audio for storage and transmission, then decompresses it for playback. It&#8217;s the difference between a 30 MB WAV file and a 3 MB MP3 that sounds nearly identical to most listeners.<\/p>\n<p>This guide walks through the definition, encoding pipeline, lossy vs lossless tradeoffs, the most common codecs in use today (AAC, MP3, Opus, FLAC, ALAC, AC-3, LDAC, SBC, and more), how Bluetooth and web browsers handle them, and how to pick the right codec for music, voice, podcasts, or live broadcasts. By the end, you&#8217;ll know which codec to plug into your next streaming pipeline and why.<\/p>\n<h2>What Is an Audio Codec?<\/h2>\n<p>An <strong>audio codec<\/strong> is a piece of software or hardware that encodes raw audio data into a compressed digital stream, then decodes that stream back into a playable signal. The word itself is a portmanteau of *coder* and *decoder*. Some codecs also include the analog-to-digital and digital-to-analog conversion stages that turn microphone voltage into bits and bits back into speaker output.<\/p>\n<figure class='wp-block-table'>\n<table>\n<thead>\n<tr>\n<th>Attribute<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Purpose<\/strong><\/td>\n<td>Compress audio for storage\/transmission, decompress for playback<\/td>\n<\/tr>\n<tr>\n<td><strong>Form<\/strong><\/td>\n<td>Software algorithm (FFmpeg, libopus) or hardware IC (Realtek ALC, Cirrus Logic CS)<\/td>\n<\/tr>\n<tr>\n<td><strong>Input<\/strong><\/td>\n<td>Raw PCM samples (typically 44.1 or 48 kHz, 16- or 24-bit)<\/td>\n<\/tr>\n<tr>\n<td><strong>Output<\/strong><\/td>\n<td>A compressed bitstream wrapped in a container (MP4, WebM, Ogg)<\/td>\n<\/tr>\n<tr>\n<td><strong>Compression ratio<\/strong><\/td>\n<td>5:1 (lossless) up to 20:1 (lossy) without obvious quality loss<\/td>\n<\/tr>\n<tr>\n<td><strong>Common examples<\/strong><\/td>\n<td>AAC, MP3, Opus, FLAC, ALAC, AC-3, Vorbis<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Two distinct meanings of &#8220;codec&#8221; coexist in everyday use:<\/p>\n<ul>\n<li><strong>Software codec<\/strong> \u2014 a program implementing an algorithm (such as the LAME MP3 encoder or libopus) that compresses and decompresses digital audio data, with the goal of representing a high-fidelity signal in as few bits as possible while keeping perceived quality intact.<\/li>\n<li><strong>Hardware codec<\/strong> \u2014 a single chip on a motherboard, smartphone, or headset that contains an analog-to-digital converter (ADC), a digital-to-analog converter (DAC), and often the compression logic itself. Realtek&#8217;s ALC series and Cirrus Logic&#8217;s CS chips are common examples on PCs and Macs.<\/li>\n<\/ul>\n<p>For more background on codecs in general, see the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Audio_codec\" target=\"_blank\" rel=\"nofollow\">Audio codec<\/a> entry on Wikipedia.<\/p>\n<h2>Audio Codec vs Audio Format vs Container<\/h2>\n<p>These three terms are often used interchangeably, which causes confusion. They&#8217;re not the same thing.<\/p>\n<figure class='wp-block-table'>\n<table>\n<thead>\n<tr>\n<th>Concept<\/th>\n<th>What it is<\/th>\n<th>Examples<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Audio codec<\/strong><\/td>\n<td>The algorithm that compresses and decompresses audio data<\/td>\n<td>AAC, MP3, Opus, FLAC, AC-3<\/td>\n<\/tr>\n<tr>\n<td><strong>Audio coding format<\/strong><\/td>\n<td>The specification that defines the bitstream syntax produced by the codec<\/td>\n<td>AAC LC, MP3, Opus, FLAC<\/td>\n<\/tr>\n<tr>\n<td><strong>Container (file format)<\/strong><\/td>\n<td>The wrapper that stores one or more audio (and sometimes video) bitstreams plus metadata<\/td>\n<td>MP4, WebM, Ogg, MKV, WAV, FLAC<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The blurry edge: some names refer to both a codec and a container. MP3 is a codec *and* a file extension, because the only thing typically inside an `.mp3` file is an MP3 audio stream. FLAC is the same \u2014 it names both a lossless codec and a native container. AAC, by contrast, is almost always packed inside an MP4 (or M4A) container, never in a file called `.aac`.<\/p>\n<p>A practical rule: when you read &#8220;the file uses AAC,&#8221; that&#8217;s the codec. When you read &#8220;the file is an `.mp4`,&#8221; that&#8217;s the container. The container can hold multiple codecs \u2014 for instance, an MP4 file might carry an H.264 video stream alongside an AAC audio stream. If you&#8217;re working with <a href=\"https:\/\/liveapi.com\/blog\/what-are-video-formats\/\" target=\"_blank\">video formats<\/a> and codecs together, this distinction matters when you transcode or mux streams.<\/p>\n<h2>How Does an Audio Codec Work?<\/h2>\n<p>An audio codec runs a five-stage pipeline. Encoding compresses; decoding reverses the process to play the audio back.<\/p>\n<p><strong>1. Sampling and quantization.<\/strong> A microphone produces a continuous analog wave. The ADC samples that wave thousands of times per second (44,100 Hz for CD quality, 48,000 Hz for most digital video) and represents each sample as a 16- or 24-bit integer. The result is raw PCM (pulse-code modulation) audio.<\/p>\n<p><strong>2. Transform.<\/strong> The encoder breaks the PCM stream into short overlapping windows (typically 20 ms) and applies a mathematical transform \u2014 usually the <strong>modified discrete cosine transform (MDCT)<\/strong> \u2014 to convert the time-domain signal into the frequency domain. This exposes which frequencies carry the most energy.<\/p>\n<p><strong>3. Psychoacoustic modeling (lossy codecs only).<\/strong> The encoder uses a model of human hearing to identify sounds you can&#8217;t perceive: quiet tones masked by louder ones, frequencies above ~20 kHz, very brief sounds buried under longer ones. These bits are discarded.<\/p>\n<p><strong>4. Quantization and entropy coding.<\/strong> Remaining frequency coefficients are quantized (rounded to a smaller set of values) and packed using entropy coding (Huffman or arithmetic) to squeeze out redundancy. The output is a compact bitstream.<\/p>\n<p><strong>5. Decoding.<\/strong> On the playback side, the decoder reverses each step: parse the bitstream, undo the entropy coding and quantization, run the inverse MDCT, and feed the reconstructed PCM samples to a DAC. The DAC drives the speaker or headphone amplifier.<\/p>\n<p>Voice codecs add a sixth technique called <strong>linear predictive coding (LPC)<\/strong>, which models the human vocal tract and transmits only the parameters needed to reconstruct speech. LPC is what lets G.711 and SILK (the speech mode inside Opus) work at extremely low bitrates \u2014 under 16 kbps for intelligible voice.<\/p>\n<p>The whole encode-decode round trip introduces a delay called <strong>algorithmic latency<\/strong>: about 100 ms for MP3, 20\u2013405 ms for AAC, and as little as 5 ms for Opus. That difference matters if you&#8217;re building real-time voice apps \u2014 see our guide on <a href=\"https:\/\/liveapi.com\/blog\/what-is-low-latency-streaming\/\" target=\"_blank\">low-latency streaming<\/a> for why every millisecond counts.<\/p>\n<h2>Lossy vs Lossless Audio Codecs<\/h2>\n<p>The single biggest decision when picking an audio codec is whether you can tolerate any loss of fidelity. Two camps exist.<\/p>\n<p><strong>Lossy codecs<\/strong> remove information the human ear is unlikely to notice. The compressed file can be 80\u201395% smaller than the original PCM, but the discarded data cannot be recovered. AAC, MP3, Opus, and Vorbis are all lossy.<\/p>\n<p><strong>Lossless codecs<\/strong> compress audio without throwing anything away. Decoding produces a bit-perfect copy of the input. File sizes shrink by roughly 40\u201360%, which is significant but nowhere near what lossy codecs achieve. FLAC, ALAC, and Apple&#8217;s lossless mode are examples.<\/p>\n<figure class='wp-block-table'>\n<table>\n<thead>\n<tr>\n<th>Attribute<\/th>\n<th>Lossy<\/th>\n<th>Lossless<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Compression ratio<\/strong><\/td>\n<td>10:1 to 20:1<\/td>\n<td>1.5:1 to 2.5:1<\/td>\n<\/tr>\n<tr>\n<td><strong>File size (3-min song)<\/strong><\/td>\n<td>3\u20138 MB<\/td>\n<td>15\u201325 MB<\/td>\n<\/tr>\n<tr>\n<td><strong>Quality vs original<\/strong><\/td>\n<td>Perceptually similar; data is gone forever<\/td>\n<td>Bit-for-bit identical<\/td>\n<\/tr>\n<tr>\n<td><strong>CPU cost to decode<\/strong><\/td>\n<td>Low<\/td>\n<td>Slightly higher<\/td>\n<\/tr>\n<tr>\n<td><strong>Best for<\/strong><\/td>\n<td>Streaming, mobile, voice, broadcast<\/td>\n<td>Archival, mastering, audiophile playback<\/td>\n<\/tr>\n<tr>\n<td><strong>Examples<\/strong><\/td>\n<td>AAC, MP3, Opus, Vorbis, AC-3<\/td>\n<td>FLAC, ALAC, WavPack, Monkey&#8217;s Audio<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>A third group, <strong>uncompressed formats<\/strong> like WAV and AIFF, store raw PCM with no compression at all. They&#8217;re simple and lossless but enormous \u2014 about 10 MB per minute of CD-quality stereo. Studios and broadcast trucks still use them for editing because uncompressed audio is the easiest to splice and mix.<\/p>\n<h2>Common Audio Codec Types<\/h2>\n<p>Below are the codecs you&#8217;ll meet most often, with the bitrates and use cases that matter when building or shipping audio products.<\/p>\n<h3>AAC (Advanced Audio Coding)<\/h3>\n<p>AAC is the de facto standard for streaming, broadcast, and mobile audio. It supports up to 48 main channels plus 16 low-frequency effects channels, bitrates from 8 kbps to 512 kbps, and is the audio codec used by YouTube, Apple Music, iTunes, and most HLS streams. AAC LC (Low Complexity) is the workhorse profile; HE-AAC and HE-AAC v2 add efficiency for very low bitrates. If you&#8217;re building HLS pipelines, AAC is almost always the default \u2014 see our guide on <a href=\"https:\/\/liveapi.com\/blog\/what-is-hls\/\" target=\"_blank\">HLS streaming<\/a> for the protocol context.<\/p>\n<h3>MP3 (MPEG-1 Audio Layer III)<\/h3>\n<p>MP3 is the codec that made digital music portable. Bitrates run from 8 kbps mono up to 320 kbps stereo. Patent restrictions expired in 2017, so MP3 is now royalty-free everywhere. It&#8217;s universally supported on every device made in the last 25 years. The downside: at the same bitrate, AAC and Opus sound noticeably better. MP3 is best treated as the lowest-common-denominator format \u2014 fine for downloads but rarely the best technical choice for new pipelines.<\/p>\n<h3>Opus<\/h3>\n<p>Opus is the modern general-purpose lossy codec. It scales from 6 kbps (intelligible voice) to 510 kbps (transparent music) and runs at latencies between 5 ms and 66.5 ms \u2014 low enough for real-time voice. It&#8217;s the default codec for WebRTC, Discord, Zoom, and YouTube&#8217;s WebM streams. Opus is open and royalty-free, defined in <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc6716\" target=\"_blank\" rel=\"nofollow\">RFC 6716<\/a>. If you&#8217;re building <a href=\"https:\/\/liveapi.com\/blog\/webrtc-live-streaming\/\" target=\"_blank\">WebRTC live streaming<\/a>, Opus is the only codec you should plan around.<\/p>\n<h3>Vorbis<\/h3>\n<p>Vorbis (often shipped in `.ogg` containers) is an older open-source lossy codec from the Xiph.Org Foundation. It outperforms MP3 at similar bitrates and was popular in games and open-source pipelines, but Opus has largely replaced it for new work.<\/p>\n<h3>FLAC (Free Lossless Audio Codec)<\/h3>\n<p>FLAC is the most widely supported lossless codec. It compresses CD-quality stereo to roughly half the size of an equivalent WAV without losing a single bit. Encoding latency is 4.3\u201392 ms depending on settings, and decoding is fast enough for any modern device. Use FLAC for archives, mastering libraries, and high-resolution music distribution.<\/p>\n<h3>ALAC (Apple Lossless Audio Codec)<\/h3>\n<p>ALAC is Apple&#8217;s lossless codec \u2014 functionally similar to FLAC, but native to iTunes, Apple Music&#8217;s lossless tier, and the Apple ecosystem. Apple open-sourced it in 2011, so encoders and decoders exist on every platform, but FLAC remains more common outside Apple devices.<\/p>\n<h3>AC-3 and E-AC-3 (Dolby Digital)<\/h3>\n<p>AC-3 carries the surround-sound audio on DVDs, ATSC television, and many streaming services. It supports up to 5.1 channels at bitrates from 32 kbps to 640 kbps. E-AC-3 (Dolby Digital Plus) extends the family to 7.1 channels and higher bitrates, and is the default surround codec on Netflix and Amazon Prime Video.<\/p>\n<h3>WAV and AIFF<\/h3>\n<p>Both are uncompressed PCM containers \u2014 WAV is the Microsoft standard, AIFF the Apple equivalent. Neither applies any compression, so a 3-minute stereo file is roughly 30 MB. They&#8217;re standard for studio work because every editor reads them and there&#8217;s no decode overhead.<\/p>\n<h3>LDAC<\/h3>\n<p>LDAC is Sony&#8217;s high-bitrate Bluetooth codec, capable of 990 kbps over Bluetooth \u2014 about three times the bitrate of standard SBC. It&#8217;s required for &#8220;Hi-Res Audio Wireless&#8221; certification and is supported on Android 8 and later. Range and battery life take a hit compared to lower-bitrate codecs.<\/p>\n<h3>SBC (Subband Codec)<\/h3>\n<p>SBC is the mandatory baseline codec for Bluetooth A2DP. Every set of Bluetooth headphones supports it. Quality at 328 kbps is acceptable but obviously inferior to AAC, aptX, or LDAC. Treat it as the safety-net codec \u2014 always available, rarely the best choice.<\/p>\n<h3>G.711 and G.722<\/h3>\n<p>These are telephony codecs. G.711 (\u03bc-law and A-law) runs at a fixed 64 kbps with 0.125 ms latency and is required by every WebRTC implementation. G.722 doubles the audio bandwidth to wideband (50 Hz \u2013 7 kHz) at the same bitrate, with 4 ms latency. Both are everywhere in VoIP and SIP traffic.<\/p>\n<p>For full bitrate, channel, and latency tables, the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Media\/Guides\/Formats\/Audio_codecs\" target=\"_blank\" rel=\"nofollow\">Web audio codec guide on MDN<\/a> is the best technical reference.<\/p>\n<h2>Hardware vs Software Audio Codecs<\/h2>\n<p>The same word, &#8220;codec,&#8221; covers two very different things.<\/p>\n<p>A <strong>software audio codec<\/strong> is just code \u2014 an algorithm running on a CPU. FFmpeg, libopus, the LAME MP3 encoder, and the AAC encoder built into Apple&#8217;s CoreAudio are all software codecs. They live in your encoding pipeline, your media player, your browser, your phone&#8217;s media framework. Software codecs are flexible: you can update them, swap them, run multiple of them, and pick configuration profiles per stream.<\/p>\n<p>A <strong>hardware audio codec<\/strong> is a physical chip that contains an ADC, a DAC, and often a small DSP that runs the compression algorithm in silicon. Realtek ALC, Cirrus Logic CS, IDT (now Tempo Semiconductor) parts, and SigmaTel chips have all played this role on PC motherboards and laptops. Smartphones and Bluetooth headsets ship dedicated audio codec ICs that handle Bluetooth SBC, AAC, and aptX in hardware to save battery. The codec chip on a USB audio interface is what turns a microphone signal into a digital stream that your computer can record.<\/p>\n<p>In a typical streaming pipeline, both are present. A hardware codec digitizes the microphone signal, then a software codec compresses it for transmission. On the receiving end, software decodes the bitstream back to PCM, then a hardware codec converts that PCM to analog for the speaker.<\/p>\n<h2>Bluetooth Audio Codecs Explained<\/h2>\n<p>Bluetooth is its own little codec ecosystem because radio bandwidth is limited and battery life matters. Five codecs do most of the work today.<\/p>\n<figure class='wp-block-table'>\n<table>\n<thead>\n<tr>\n<th>Codec<\/th>\n<th>Bitrate<\/th>\n<th>Latency<\/th>\n<th>Best for<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>SBC<\/strong><\/td>\n<td>192\u2013328 kbps<\/td>\n<td>100\u2013270 ms<\/td>\n<td>Mandatory baseline, every headset<\/td>\n<\/tr>\n<tr>\n<td><strong>AAC<\/strong><\/td>\n<td>128\u2013256 kbps<\/td>\n<td>100\u2013200 ms<\/td>\n<td>iPhone, default Apple ecosystem<\/td>\n<\/tr>\n<tr>\n<td><strong>aptX \/ aptX HD<\/strong><\/td>\n<td>352 kbps \/ 576 kbps<\/td>\n<td>60\u2013150 ms<\/td>\n<td>Android, near-CD quality<\/td>\n<\/tr>\n<tr>\n<td><strong>aptX Low Latency<\/strong><\/td>\n<td>352 kbps<\/td>\n<td>~40 ms<\/td>\n<td>Gaming, video sync<\/td>\n<\/tr>\n<tr>\n<td><strong>LDAC<\/strong><\/td>\n<td>330 \/ 660 \/ 990 kbps<\/td>\n<td>~150 ms<\/td>\n<td>Sony, Hi-Res Audio Wireless<\/td>\n<\/tr>\n<tr>\n<td><strong>LC3<\/strong><\/td>\n<td>160\u2013345 kbps<\/td>\n<td>~30 ms<\/td>\n<td>LE Audio, hearing aids<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The newest entry, <strong>LC3<\/strong>, is the codec at the heart of Bluetooth LE Audio. It delivers SBC-or-better quality at roughly half the bitrate, which means longer battery life and the ability to broadcast a single audio stream to many receivers (Auracast). Expect LC3 to displace SBC over the next several years.<\/p>\n<p>What gets used at any moment depends on negotiation: when a phone connects to headphones, both ends advertise the codecs they support, and the higher-tier match wins. iPhones default to AAC; most Android phones default to SBC unless the user enables aptX or LDAC in developer options.<\/p>\n<h2>Audio Codecs in Live Streaming<\/h2>\n<p>Live streaming pipelines have a narrower codec menu than file-based audio. Two factors drive the choice: which codec the streaming protocol allows, and what every receiving device can decode without transcoding.<\/p>\n<p><strong>RTMP<\/strong> historically carried MP3 or AAC audio. AAC has won \u2014 modern <a href=\"https:\/\/liveapi.com\/blog\/rtmp-encoder\/\" target=\"_blank\">RTMP encoders<\/a> and most RTMP servers default to AAC LC at 96\u2013192 kbps stereo. If you&#8217;re running an <a href=\"https:\/\/liveapi.com\/blog\/rtmp-server\/\" target=\"_blank\">RTMP server<\/a>, expect every incoming stream to use AAC.<\/p>\n<p><strong>HLS<\/strong> carries AAC for VOD and live, plus AC-3 and E-AC-3 for multi-channel surround. The HLS spec also permits raw audio as `.aac` segments for audio-only streams. AAC is the only audio codec you can rely on for reach across iOS, Android, smart TVs, and set-top boxes.<\/p>\n<p><strong>SRT<\/strong> is transport-agnostic \u2014 it doesn&#8217;t care which audio codec you carry inside the MPEG-TS payload. AAC and AC-3 are typical. If you&#8217;re building broadcast workflows over <a href=\"https:\/\/liveapi.com\/blog\/srt-protocol\/\" target=\"_blank\">the SRT protocol<\/a>, the codec choice follows whatever your downstream tooling expects.<\/p>\n<p><strong>WebRTC<\/strong> restricts you to two codecs: Opus and G.711. Opus is the default for everything except telephony interconnect. Latency under 100 ms end-to-end depends on Opus&#8217;s short frames and low algorithmic delay.<\/p>\n<p><strong>MPEG-DASH and CMAF<\/strong> mirror HLS \u2014 AAC for stereo, AC-3 \/ E-AC-3 \/ AC-4 for surround. CMAF specifically allows the same fragmented-MP4 segments to be packaged for both HLS and DASH playback.<\/p>\n<p>LiveAPI handles the audio side of live streaming for you \u2014 it ingests RTMP, SRT, and RTSP streams (with AAC audio), packages them into HLS for global delivery via Akamai, Cloudflare, or Fastly, and stores the audio track unchanged so live streams roll over to VOD without re-encoding. If you need an audio-only stream (a podcast or sports radio broadcast), LiveAPI&#8217;s audio-only mode keeps the AAC track and skips video processing entirely. See our guide on <a href=\"https:\/\/liveapi.com\/blog\/how-to-build-a-video-streaming-app\/\" target=\"_blank\">building a video streaming app<\/a> for the full picture, or the <a href=\"https:\/\/liveapi.com\/blog\/video-transcoding-api\/\" target=\"_blank\">video transcoding API<\/a> page for transcoding details.<\/p>\n<hr \/>\n<p>So far, we&#8217;ve covered the theory and the codec menu. The next question is the practical one: given your specific use case, which codec should you actually pick, and how do you avoid the most common playback errors? The remaining sections answer those questions.<\/p>\n<h2>How to Choose an Audio Codec<\/h2>\n<p>Five questions narrow the choice down to one or two codecs.<\/p>\n<p><strong>1. What&#8217;s the use case?<\/strong> Streaming music, voice\/VoIP, podcast download, archival, or broadcast each have a default winner. Music streaming \u2192 AAC. VoIP \/ real-time voice \u2192 Opus or G.722. Podcast downloads \u2192 AAC at 96 kbps mono or 128 kbps stereo. Archival \u2192 FLAC. Broadcast surround \u2192 AC-3 \/ E-AC-3.<\/p>\n<p><strong>2. Where will it be decoded?<\/strong> If your audience plays back on every browser and every phone, AAC is the safest pick because it&#8217;s universal. If you control the player (your own app or a desktop client), Opus is the strongest technical choice for both voice and music.<\/p>\n<p><strong>3. What latency do you need?<\/strong> Real-time conversation requires sub-100 ms end-to-end, which forces Opus or G.722. Live broadcast can absorb 2\u201310 seconds, so AAC works fine. On-demand playback has no latency budget worth worrying about.<\/p>\n<p><strong>4. What bitrate budget do you have?<\/strong> Cellular and satellite links favor low bitrates \u2014 Opus at 24 kbps is intelligible for voice; AAC HE-AAC v2 at 32 kbps stereo is acceptable for music. Wi-Fi and wired links rarely need anything below 96 kbps.<\/p>\n<p><strong>5. Are there licensing constraints?<\/strong> Opus, FLAC, and Vorbis are royalty-free. AAC, AC-3, and LDAC require patent licenses for some commercial uses (most modern hardware ships with the licenses paid, but check before redistributing encoders). MP3 is now royalty-free everywhere.<\/p>\n<p>A quick decision matrix:<\/p>\n<figure class='wp-block-table'>\n<table>\n<thead>\n<tr>\n<th>Use case<\/th>\n<th>Recommended codec<\/th>\n<th>Bitrate<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Music streaming (general web)<\/td>\n<td>AAC LC<\/td>\n<td>128\u2013256 kbps<\/td>\n<\/tr>\n<tr>\n<td>Music streaming (own player)<\/td>\n<td>Opus<\/td>\n<td>96\u2013192 kbps<\/td>\n<\/tr>\n<tr>\n<td>Podcast download<\/td>\n<td>AAC LC<\/td>\n<td>96 kbps mono<\/td>\n<\/tr>\n<tr>\n<td>Voice \/ VoIP<\/td>\n<td>Opus<\/td>\n<td>24\u201348 kbps<\/td>\n<\/tr>\n<tr>\n<td>Telephony interop<\/td>\n<td>G.711<\/td>\n<td>64 kbps<\/td>\n<\/tr>\n<tr>\n<td>Live broadcast (HLS)<\/td>\n<td>AAC LC<\/td>\n<td>128 kbps<\/td>\n<\/tr>\n<tr>\n<td>Live broadcast (WebRTC)<\/td>\n<td>Opus<\/td>\n<td>32\u201364 kbps<\/td>\n<\/tr>\n<tr>\n<td>Surround for OTT<\/td>\n<td>E-AC-3<\/td>\n<td>384\u2013768 kbps<\/td>\n<\/tr>\n<tr>\n<td>Lossless archival<\/td>\n<td>FLAC<\/td>\n<td>Variable (~800 kbps)<\/td>\n<\/tr>\n<tr>\n<td>Bluetooth headphones<\/td>\n<td>AAC (Apple) \/ aptX or LDAC (Android)<\/td>\n<td>Negotiated<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>If you&#8217;re choosing a codec to pair with a video stream, the same use-case logic applies \u2014 see our guides on <a href=\"https:\/\/liveapi.com\/blog\/hevc-vs-h264\/\" target=\"_blank\">HEVC vs H.264<\/a> and <a href=\"https:\/\/liveapi.com\/blog\/av1-codec\/\" target=\"_blank\">the AV1 codec<\/a> for the visual side.<\/p>\n<h2>Common Audio Codec Issues and Fixes<\/h2>\n<p>Two recurring problems show up in support tickets and forums.<\/p>\n<p><strong>&#8220;Audio codec not supported&#8221; errors.<\/strong> This usually means the playback device can&#8217;t decode the codec inside the container. A common case: a video file uses E-AC-3 audio, but the target Android phone only supports AAC. Fix it by <a href=\"https:\/\/liveapi.com\/blog\/what-is-video-transcoding\/\" target=\"_blank\">transcoding<\/a> the audio to AAC. Another case: a `.mkv` file with FLAC audio plays in VLC but not in Apple&#8217;s QuickTime, because QuickTime doesn&#8217;t support that combination \u2014 repackage the audio into AAC or use a player with broader codec support.<\/p>\n<p><strong>Audio out of sync with video.<\/strong> Codec latency is the usual cause. If the audio codec adds 100 ms of algorithmic delay (MP3) and the video codec adds none, the audio arrives late. Encoders compensate with negative audio timestamps; if yours doesn&#8217;t, switch to a lower-latency audio codec (AAC or Opus) or set an explicit audio offset.<\/p>\n<p><strong>Bitrate spikes and buffering.<\/strong> Variable bitrate (VBR) audio can briefly exceed the average target during loud passages, which causes buffering on slow networks. Switch to constant bitrate (CBR) or constrained VBR for live streams. The same logic applies to <a href=\"https:\/\/liveapi.com\/blog\/adaptive-bitrate-streaming\/\" target=\"_blank\">adaptive bitrate streaming<\/a> \u2014 keep audio bitrate constant across renditions and let video carry the bandwidth burden.<\/p>\n<h2>Audio Codec FAQ<\/h2>\n<h3>What is an audio codec in simple terms?<\/h3>\n<p>An audio codec is a tool \u2014 software or hardware \u2014 that shrinks audio data so it can be stored or sent quickly, then expands it again so you can hear it. Think of it as a translator: PCM goes in, a smaller compressed file comes out, and on the other end the codec turns that small file back into something a speaker can play.<\/p>\n<h3>Is MP3 a codec or a format?<\/h3>\n<p>Both. &#8220;MP3&#8221; names the codec (MPEG-1 Audio Layer III) that compresses the audio, and `.mp3` is also the file format people use to wrap MP3-encoded data. The dual meaning is harmless because MP3 audio is almost always stored in `.mp3` files, but technically the codec and the container are separate concepts.<\/p>\n<h3>What audio codec does YouTube use?<\/h3>\n<p>YouTube delivers audio in either AAC LC (inside MP4 containers) or Opus (inside WebM containers), depending on which format your client requests. Higher-quality streams (256 kbps+) use Opus; the AAC streams cap at 128\u2013192 kbps.<\/p>\n<h3>What is the best Bluetooth audio codec?<\/h3>\n<p>LDAC delivers the highest bitrate (up to 990 kbps), but only Sony products and recent Android phones support it. AAC is the default on iPhone. aptX HD and aptX Adaptive are common on Android. LC3 (in LE Audio) will likely become the new default over the next few years because it sounds as good as SBC at half the bitrate.<\/p>\n<h3>What&#8217;s the difference between an audio codec and a video codec?<\/h3>\n<p>An audio codec compresses sound waves; a <a href=\"https:\/\/liveapi.com\/blog\/what-is-video-codec\/\" target=\"_blank\">video codec<\/a> compresses moving images. They use different algorithms tuned to the perceptual quirks of each medium \u2014 audio codecs exploit psychoacoustic masking, video codecs exploit spatial and temporal redundancy. A media file usually contains one of each (e.g., H.264 video + AAC audio in an MP4).<\/p>\n<h3>Are FLAC and ALAC the same?<\/h3>\n<p>They are functionally similar \u2014 both are lossless and produce roughly the same compression ratio \u2014 but they are different file formats with different bitstreams. FLAC is open and widely supported; ALAC is Apple&#8217;s equivalent and is the format used by Apple Music&#8217;s lossless tier. Most modern players read both.<\/p>\n<h3>Why does Opus beat MP3 at the same bitrate?<\/h3>\n<p>Opus is 25 years newer and combines two algorithms \u2014 SILK for speech and CELT for music \u2014 that the encoder switches between based on the content. It also uses smarter psychoacoustic modeling and shorter frames. The result is intelligible voice down to 6 kbps and transparent music around 96 kbps, where MP3 needs 128\u2013192 kbps to sound the same.<\/p>\n<h3>Can I change a file&#8217;s audio codec without losing quality?<\/h3>\n<p>Only if you go from a lossless source. Re-encoding lossy audio (MP3 \u2192 AAC, for instance) compounds the original quality loss because the second codec discards data the first codec already removed. If you have a FLAC or WAV master, you can produce AAC, MP3, or Opus from it freely. If you only have an MP3, accept that any conversion will sound a little worse than the original.<\/p>\n<h3>How many audio channels can a codec support?<\/h3>\n<p>It depends on the codec. AAC supports up to 48 main channels plus 16 LFE. Opus supports up to 255 channels plus one LFE. AC-3 caps at 5.1; E-AC-3 at 7.1; AC-4 supports object-based audio (Atmos). Most consumer playback caps at 7.1 because that&#8217;s what AV receivers and TVs decode.<\/p>\n<h2>Closing Thoughts<\/h2>\n<p>An audio codec is doing real work every time you stream a song, take a call, or watch a video \u2014 it&#8217;s just invisible because it works. The choice between AAC, Opus, MP3, FLAC, and the rest is rarely about which sounds best in the abstract; it&#8217;s about which one matches your protocol, your latency budget, your audience&#8217;s playback devices, and your bitrate ceiling.<\/p>\n<p>For most teams shipping a streaming product today, the answer is short: AAC for compatibility-first delivery (HLS, downloads, broadcast), Opus for real-time voice and modern web playback, FLAC when bit-perfect quality matters, and AC-3 \/ E-AC-3 when you need surround.<\/p>\n<p>If you&#8217;re building a live streaming or video hosting product and don&#8217;t want to wire up audio packaging yourself, <a href=\"https:\/\/liveapi.com\/\" target=\"_blank\">Get started with LiveAPI<\/a> \u2014 it ingests AAC over RTMP, SRT, and RTSP, packages live streams to HLS with multi-CDN delivery, and rolls them over to VOD automatically, so your audio just works end to end.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">13<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> Every podcast, music stream, video call, and Bluetooth playback you hear today passes through an audio codec. Without one, a three-minute song would weigh in at roughly 30 MB, and a single hour of stereo audio would chew through more than 600 MB of bandwidth. So what is an audio codec, and why does it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1016,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_title":"What Is an Audio Codec? How It Works, Types & Examples %%sep%% %%sitename%%","_yoast_wpseo_metadesc":"Learn what an audio codec is, how encoding and decoding work, lossy vs lossless types, top codecs (AAC, MP3, Opus, FLAC), and how to pick one.","inline_featured_image":false,"footnotes":""},"categories":[6,20],"tags":[],"class_list":["post-1015","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codec","category-audio"],"jetpack_featured_media_url":"https:\/\/liveapi.com\/blog\/wp-content\/uploads\/2026\/05\/what-is-audio-codec.jpg","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.6.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"Learn what an audio codec is, how encoding and decoding work, lossy vs lossless types, top codecs (AAC, MP3, Opus, FLAC), and how to pick one.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is an Audio Codec? How It Works, Types &amp; Examples - LiveAPI Blog\" \/>\n<meta property=\"og:description\" content=\"Learn what an audio codec is, how encoding and decoding work, lossy vs lossless types, top codecs (AAC, MP3, Opus, FLAC), and how to pick one.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/\" \/>\n<meta property=\"og:site_name\" content=\"LiveAPI Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-08T02:45:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-08T02:46:27+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"19 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/liveapi.com\/blog\/#website\",\"url\":\"https:\/\/liveapi.com\/blog\/\",\"name\":\"LiveAPI Blog\",\"description\":\"Live Video Streaming API Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/liveapi.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/liveapi.com\/blog\/wp-content\/uploads\/2026\/05\/what-is-audio-codec.jpg\",\"width\":1880,\"height\":1253,\"caption\":\"Photo by Pixabay on Pexels\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/#webpage\",\"url\":\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/\",\"name\":\"What Is an Audio Codec? How It Works, Types & Examples - LiveAPI Blog\",\"isPartOf\":{\"@id\":\"https:\/\/liveapi.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/#primaryimage\"},\"datePublished\":\"2026-05-08T02:45:58+00:00\",\"dateModified\":\"2026-05-08T02:46:27+00:00\",\"author\":{\"@id\":\"https:\/\/liveapi.com\/blog\/#\/schema\/person\/98f2ee8b3a0bd93351c0d9e8ce490e4a\"},\"description\":\"Learn what an audio codec is, how encoding and decoding work, lossy vs lossless types, top codecs (AAC, MP3, Opus, FLAC), and how to pick one.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/liveapi.com\/blog\/what-is-audio-codec\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/liveapi.com\/blog\/#\/schema\/person\/98f2ee8b3a0bd93351c0d9e8ce490e4a\",\"name\":\"govz\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/liveapi.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ab5cbe0543c0a44dc944c720159323bd001fc39a8ba5b1f137cd22e7578e84c9?s=96&d=mm&r=g\",\"caption\":\"govz\"},\"sameAs\":[\"https:\/\/liveapi.com\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/posts\/1015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/comments?post=1015"}],"version-history":[{"count":1,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/posts\/1015\/revisions"}],"predecessor-version":[{"id":1017,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/posts\/1015\/revisions\/1017"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/media\/1016"}],"wp:attachment":[{"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/media?parent=1015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/categories?post=1015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liveapi.com\/blog\/wp-json\/wp\/v2\/tags?post=1015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}