Streaming, Gaming & Smart Devices

Audio Codecs and Streaming Quality

Compare MP3, AAC, Opus and lossless formats, understand bitrate and Bluetooth codecs, and choose settings worth the data.

Key takeaways

  • Lossy codecs discard sound you're unlikely to notice, while lossless codecs reconstruct the original digital audio exactly.
  • Bitrates are only comparable within the same codec, because newer designs do more with fewer bits.
  • Your Bluetooth connection has its own codec, which can become the weakest link regardless of the streaming setting.
  • Converting between lossy formats loses quality each time, so keep an original and convert from that.

For most listening, a modern lossy codec such as AAC or Opus at a moderate to high bitrate sounds very close to the original. Lossless formats such as FLAC or ALAC keep every sample, at several times the data. Over ordinary Bluetooth headphones the signal is usually compressed again on the way to your ears, which narrows the advantage.

The best setting depends on your gear, your surroundings and your data plan. The headphones and the recording itself typically make a bigger difference than the codec.

How digital audio is measured

Sound is captured by measuring the signal many thousands of times a second. The sample rate is how often, and the bit depth is how precisely each measurement is recorded.

Audio CDs use 44,100 samples per second, 16 bits each, in two channels. Multiply those and you get 1,411.2 kilobits per second of raw audio. Video production commonly uses 48 kHz. Higher rates and 24-bit depth are used in recording, where the extra room helps during editing; whether they're audible in finished playback is much debated.

The CD audio format
44.1 kHz samples per second for each channel 16 bit precision of each sample 2 channels, left and right 1,411 kbps uncompressed data rate 44.1 kHz samples per second for each channel 16 bit precision of each sample 2 channels, left and right 1,411 kbps uncompressed data rate

Basis: Compact Disc Digital Audio (Red Book) format.

Lossless and lossy

Uncompressed formats such as WAV or AIFF store samples directly. Lossless compression, such as FLAC or Apple's ALAC, packs them more tightly and restores them bit for bit, often at around half to two thirds of the original size, depending on the music.

Lossy compression goes further using a model of human hearing. A loud sound can hide a quieter one close to it in pitch or time, so the encoder spends few or no bits on what's masked. Done well at sufficient bitrate, many listeners can't reliably tell it apart from the source. At low bitrates you may hear swishy cymbals, smeared applause or dull high frequencies.

The codecs you'll meet

Codec Type Where you meet it
MP3 Lossy Podcasts, older files, nearly universal playback
AAC Lossy Music and video streaming, Apple devices, broadcast
Ogg Vorbis Lossy Some music services, games
Opus Lossy Voice calls, WebRTC, web video
FLAC Lossless Archives, lossless streaming tiers
ALAC Lossless Apple's ecosystem

MP3 is old and plays everywhere. Newer codecs generally match its quality with fewer bits.

AAC was designed as a successor and is very widely supported. It has variants, including ones tuned for low bitrates.

Opus, standardized by the IETF in RFC 6716, covers speech through full-band music, works at very low delay and is royalty-free. It's a mandatory audio codec in WebRTC.

FLAC is free and open, and a common choice for lossless libraries.

Bitrate in practice

Bitrate is kilobits per second. For the same codec, more bits generally means better quality, with diminishing returns. Variable bitrate encoding spends more on complex passages and less on simple ones.

Rough guidance for lossy audio:

  • Speech: Opus stays intelligible at very low rates; 64 kbps mono in MP3 or AAC is a common podcast neighborhood.
  • Casual music: around 128 to 160 kbps in AAC or Opus satisfies many listeners.
  • Careful listening: 256 to 320 kbps leaves little to complain about for most people.

Use this to estimate data. At 128 kbps, an hour is about 58 MB. At 320 kbps, about 144 MB. CD-quality lossless often lands somewhere around 300 to 600 MB per hour, depending on the material.

Bluetooth adds its own codec

When you play over Bluetooth, your phone usually decodes the stream and encodes it again for the wireless link. The headphones and phone agree on a codec both support.

Why Bluetooth can re-compress your music
1 Streamed file Arrives compressed, for example as AAC or FLAC. 2 Phone decodes Audio is unpacked and mixed with system sounds. 3 Encode for wireless A Bluetooth codec compresses it again. 4 Headphones decode Audio is unpacked and converted to sound. Streamed file Arrives compressed, for example as AAC or FLAC. 1 Phone decodes Audio is unpacked and mixed with system sounds. 2 Encode for wireless A Bluetooth codec compresses it again. 3 Headphones decode Audio is unpacked and converted to sound. 4
  • SBC is the codec every classic Bluetooth stereo device must support. Quality depends on the settings the devices negotiate.
  • AAC is common, especially with Apple products.
  • aptX variants and LDAC are vendor-developed options that some phones and headphones support.
  • LC3 arrived with Bluetooth LE Audio and is designed to be more efficient than SBC.

Both ends need support, and a fancy codec on one side does nothing alone. Higher-rate modes may fall back when the signal is crowded. Standard Bluetooth modes don't carry full lossless CD audio, although some vendors offer near-lossless or lossless modes under specific conditions. Bluetooth and BLE covers the radio side.

When you use the headset microphone on a call, many devices switch to a lower-quality voice mode, so music suddenly sounds thin. That's expected.

Containers and file extensions

An extension doesn't always tell you the codec. A .m4a file is an MP4 container that may hold lossy AAC or lossless ALAC. An .ogg file can carry Vorbis, Opus or even FLAC. A .webm file often holds Opus audio. A .wav usually contains uncompressed samples but can hold other things.

If a file won't play, the device probably lacks support for the codec inside. Media information tools can report it. With FFmpeg installed, this command works on Windows, macOS and Linux.

ffprobe -v error -show_entries stream=codec_name,sample_rate,channels,bit_rate song.m4a

The same relationship between wrapper and contents applies to video, covered in the video codec guide.

Surround and spatial audio

Films and some music come in more than two channels. Surround formats from companies such as Dolby and DTS carry channels for speakers around the room, and newer object-based formats describe where sounds should be so the playback system can place them with whatever speakers it has. Headphone "spatial audio" simulates this with signal processing, sometimes tracking your head movements.

To get it, every link has to cooperate: the title, your plan, the app, the player, the cable or wireless link and the speakers. If one doesn't, you'll usually get a stereo or simpler surround version instead. On a TV, check the audio output setting and which connection feeds your sound bar. HDMI with an audio return channel generally supports more formats than older optical cables.

Voice calls use different priorities

Calls care about delay and clarity of speech more than fidelity. Codecs used there send tiny packets many times a second, cope with some loss and cut the bitrate during silence. Noise suppression and echo cancellation shape the sound as much as the codec does. That's why music played over a call tends to sound poor: the processing treats sustained notes as noise. Some meeting apps include a music or original-sound mode that relaxes it, and better conferencing sound covers the rest.

What to set on your streaming app

  1. On home Wi-Fi with wired headphones or good speakers: use the highest quality you pay for.
  2. On mobile data: choose a normal or high lossy setting, and keep lossless off unless your plan is generous.
  3. In noisy places: the difference between high lossy and lossless is very hard to hear, so save the data.
  4. For offline listening: weigh storage space against quality.
  5. Check normalization and equalizer settings, which can change the sound more than bitrate.

If playback stutters at high quality, step down. Data caps and weak signal are the usual reasons.

Testing whether you can hear a difference

Expectation strongly affects what we hear. For a fair comparison, use the same recording and master, match the volume closely and compare blind, with someone else switching or with software that randomizes the order. Repeat enough times that guessing can't explain your score.

Different services may also carry different masters of the same album, so a difference you hear between apps may have nothing to do with codecs.

Choosing formats for your own files

For an archive of recordings or ripped discs you own, keep lossless copies such as FLAC. Make lossy copies from those for portable devices. For publishing a podcast, MP3 remains the most compatible choice; see how podcasts are distributed. For live voice, Opus is excellent where supported, while many streaming platforms expect AAC; live streaming explains why.

Converting a lossy file to FLAC doesn't restore anything. It just stores the damaged audio in a larger file. To trim clips without installing software, the audio trimmer can help; keep your original in case you want to start again.

Where quality usually gets lost

If something sounds wrong, check these before blaming the codec:

  • The app has dropped to a low setting for mobile data or a weak signal.
  • The earbuds don't seal well, so bass disappears.
  • An equalizer or "enhancer" is boosting until the sound clips.
  • The headset has switched to its call mode because some app is using the microphone.
  • The file was converted several times, each pass removing a little more.
  • The recording itself was mastered very loud, with little contrast between quiet and loud.

Changing one of these at a time, with the same familiar song, shows quickly which is responsible.

Common questions

Is a bigger number always better?

No. A 128 kbps Opus file can sound better than a 128 kbps MP3, and a good master at moderate bitrate beats a poor one at a high rate.

Do I need special hardware for lossless?

A capable wired output or digital-to-analog converter and decent headphones let you benefit. Over common Bluetooth links, much of the advantage is lost.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Streaming, Gaming & Smart Devices →

Latest news on this topic