Files and codecs 10 min read
Digital Audio Files, Codecs and Compression
Separate containers, codecs and transports, compare audio formats and choose suitable files for playback, recording and conferencing.
- Distinguish codecs, containers, file extensions and transports.
- Explain uncompressed, lossless and lossy audio.
- Compare WAV, AIFF, FLAC, MP3, AAC and Opus.
- Estimate file size from bitrate and duration.
- Choose appropriate formats for DSP playback, archiving and conferencing.
Why an AV engineer should care
“The device supports WAV” sounds reassuring until the file refuses to play.
One WAV file might contain 16-bit PCM at 44.1 kHz. Another might contain 32-bit floating-point audio at 96 kHz. A third might have six channels, unusual metadata or a file size the device cannot address. They share an extension while being substantially different inside.
Commercial AV systems encounter audio as:
- DSP announcement and paging files
- Background-music files and streams
- USB and HDMI audio
- Dante or AES67 PCM
- Conferencing codecs
- Recorded meetings
- Streaming and signage content
Correctly separating the audio format, codec, container and transport prevents a great deal of “but it plays on my laptop” troubleshooting.
1. The four layers people call “format”
Several different things are commonly described as the file’s format.
| Layer | What it describes | Examples |
|---|---|---|
| Audio representation or codec | How audio samples are encoded | PCM, FLAC, MP3, AAC, Opus |
| Container | Structure holding audio and metadata | WAV/RIFF, AIFF, MP4, Ogg |
| File extension | Filename hint | .wav, .flac, .mp3, .m4a |
| Transport | How audio moves between systems | Dante, AES67, USB, HDMI, RTP |
These layers can be combined in different ways.
For example:
- A WAV container usually holds PCM, but WAV can describe other codecs.
- AAC audio may appear inside an MP4 container with an
.m4aextension. - Opus commonly travels through WebRTC or RTP and can also be stored in an Ogg container.
- Dante transports uncompressed PCM without creating a WAV file.
An extension helps software guess what is inside. It does not prove the exact codec, sample rate, bit depth or channel arrangement.
Microsoft documents WAV as a RIFF structure containing separate format and audio-data chunks. Its format header identifies the actual encoding and channel characteristics. (learn.microsoft.com, learn.microsoft.com)
2. Uncompressed PCM
PCM represents each sample directly as a number. The data rate depends on:
sample rate × bit depth × channel count
PCM preserves the samples without perceptual compression. It is easy for equipment to decode and supports predictable timing, but it consumes more storage and bandwidth.
WAV
WAV, or Waveform Audio File Format, is a Microsoft/IBM RIFF-based container. In AV work, it usually contains PCM.
Typical uses include:
- Paging messages
- Emergency announcements
- Test signals
- DSP playback
- Recording masters
- Audio used for later editing
WAV is widely supported, but embedded products may impose limits on:
- Sample rate
- Bit depth
- Mono versus stereo
- Channel count
- Maximum file size
- PCM integer versus floating-point samples
AIFF
AIFF is an Apple-originated container serving a similar role to WAV. It commonly contains uncompressed PCM and appears more often in music-production workflows.
For commercial AV systems, WAV is generally the safer delivery format unless the equipment documentation explicitly lists AIFF.
BWF
Broadcast Wave Format, or BWF, extends WAV with professional metadata such as timestamps, origin information and descriptions. The underlying audio can still be PCM.
BWF is useful for production and synchronized recording. A simple DSP player may ignore the extra metadata or occasionally object to a file created by specialized software, so test the exported deliverable on the actual target.
3. Lossless compression
A lossless codec reduces storage while allowing the decoder to reconstruct the original samples exactly.
It works somewhat like ZIP compression, but it is optimized for predictable patterns in audio. Compression efficiency changes with the program material.
FLAC
FLAC means Free Lossless Audio Codec.
A FLAC file is generally smaller than the equivalent PCM WAV while decoding back into the same samples. Xiph’s official description confirms that FLAC compresses audio without losing information. (xiph.org)
FLAC is useful for:
- Long-form system recordings
- Music archives
- Master-file storage
- Applications where quality must be retained but storage matters
It requires more decoding work than PCM, although that is trivial for modern computers and many DSPs.
ALAC
ALAC, Apple Lossless Audio Codec, performs the same general job within Apple-oriented workflows. Device support is less universal in commercial DSP products, so FLAC or PCM WAV is usually easier to exchange.
Lossless does not mean uncompressed. It means decompression restores the original samples exactly.
4. Lossy compression
A lossy codec permanently removes information to achieve much smaller data rates.
The encoder uses psychoacoustic models to discard or simplify content expected to be less audible. At suitable settings, the result may sound excellent. At aggressive settings, artifacts become obvious:
- Swirling or watery high frequencies
- Metallic speech
- Smeared transients
- Reduced stereo detail
- Pre-echo around sharp sounds
MP3
MP3 is mature, widely supported and convenient for music or noncritical playback. Its compression efficiency is lower than newer codecs at comparable perceived quality, but practically everything can decode it.
AAC
AAC is common in streaming, mobile devices and MP4-based media. At a given bitrate, it generally provides better efficiency than older MP3 implementations.
An .m4a file often contains AAC, but the extension alone does not guarantee that. It could also contain ALAC.
Opus
Opus was designed for interactive speech and music over networks. The IETF specification covers applications including VoIP, videoconferencing and live distributed music, with operation from very low speech bitrates through high-quality stereo. (datatracker.ietf.org)
Opus supports:
- Low algorithmic delay
- Variable bitrate
- Narrowband through full-band audio
- Packet-loss concealment
- Speech and music modes
That makes it well suited to conferencing and WebRTC. It is a different tool from the PCM used internally by most commercial DSPs.
5. Two meanings of “compression”
Audio engineers use compression for two unrelated processes.
Data compression
Reduces the number of bits required to store or transport audio:
- FLAC
- MP3
- AAC
- Opus
Dynamic-range compression
Changes the signal level over time so loud portions are reduced relative to quiet portions.
This is the DSP block with threshold, ratio, attack, release and makeup gain. It does not reduce the file size or network bitrate.
A codec can contain heavily dynamic-compressed audio. A WAV file can contain completely uncompressed data representing audio that has been crushed by a compressor. Same word, different crime scene.
6. Bitrate and file size
For PCM, bitrate follows directly from sample rate, bit depth and channel count.
A stereo 48 kHz/24-bit file has a raw bitrate of:
48,000 × 24 × 2 = 2,304,000 b/s = 2.304 Mb/s
Per hour:
2.304 Mb/s × 3,600 s ÷ 8 = 1,036.8 MB ≈ 1.04 GB
Compare that with 128 kb/s compressed audio:
128,000 b/s × 3,600 s ÷ 8 = 57,600,000 bytes = 57.6 MB per hour
Lossless FLAC falls somewhere between those values depending on the material.
CBR and VBR
Constant bitrate, or CBR, maintains approximately the same number of bits per second.
Variable bitrate, or VBR, spends more data on complex passages and less on simple ones. VBR is usually more storage-efficient, but some older embedded players behave better with CBR.
Bitrate cannot be compared without naming the codec. A 128 kb/s Opus stream and 128 kb/s MP3 file use different algorithms and may deliver different quality and latency.
7. Multiple encodes cause generation loss
Lossy encoding throws information away. Decoding an MP3 into WAV does not restore that information; it creates an uncompressed copy of the already-lossy result.
Encoding that WAV into AAC removes additional information. Repeating the process can progressively damage the audio.
A sensible workflow is:
- Preserve a PCM WAV, BWF or lossless FLAC master.
- Perform editing from that master.
- Create MP3, AAC or Opus deliverables as needed.
- Avoid using a lossy deliverable as the source for another lossy encode.
This matters for client-provided announcement audio. The file may already have passed through email, a phone recorder, an MP3 export and someone’s mysterious “audio converter” website before reaching the DSP.
8. Practical example: Q-SYS paging and message playback
Current Q-SYS Audio Player documentation lists WAV, MP3 and FLAC support, with a maximum supported file size of 4 GB. (help.qsys.com) Exact capabilities can still vary with Core model, software version and component configuration.
For critical prerecorded messages, the system designer should request or create:
- Mono PCM WAV unless stereo is genuinely required
- 48 kHz sample rate
- Supported integer bit depth
- Controlled peak and average levels
- Clean leading and trailing silence
- A filename that identifies message and revision
Keep the master file separately from the DSP-ready export. Then test playback through the actual Core and final loudspeaker path.
MP3 may be reasonable for background music. PCM WAV is preferable for short critical messages because decoding is simple and there are no perceptual-compression artifacts.
9. Practical example: conferencing versus Dante
Within a conferencing DSP, audio commonly remains 48 kHz/24-bit PCM. Dante or AES67 transports that PCM across the LAN.
Once the call leaves through Teams, Zoom or another conferencing platform, the application encodes the audio for the WAN using a compressed real-time codec. The bitrate may change continuously based on content and network conditions.
Therefore:
- A 64 or 128 kb/s conference stream does not indicate the internal DSP audio quality.
- A 1.152 Mb/s Dante mono channel does not mean that much internet bandwidth is required per participant.
- Testing a conference call requires evaluating both the local PCM signal path and the remote codec/network path.
The codec boundary is an excellent place to divide troubleshooting: Does the signal sound clean before encoding, and what returns after decoding?
Practical exercise
Choose the best delivery format for each situation:
- Ten-second life-safety announcement stored in a DSP
- Two-hour multichannel commissioning recording
- Interactive browser-based conference call
- Background music sent to a basic embedded player
Suggested choices:
- Supported mono PCM WAV
- Multichannel WAV/BWF or FLAC
- Opus or the platform’s negotiated real-time codec
- Supported MP3, AAC or FLAC depending on storage and player capability
For every supplied file, inspect:
- Codec
- Container
- Sample rate
- Bit depth
- Channel count
- Bitrate
- Duration
- File size
Compact glossary
- Codec: Method used to encode and decode audio.
- Container: File structure holding audio and metadata.
- PCM: Uncompressed numeric audio samples.
- WAV: RIFF-based audio container, commonly containing PCM.
- BWF: Broadcast Wave Format with professional metadata.
- FLAC: Free Lossless Audio Codec.
- Lossy: Compression that permanently discards information.
- Lossless: Compression that reconstructs the original samples.
- CBR: Constant bitrate.
- VBR: Variable bitrate.
- Transcoding: Converting from one encoded format to another.
- Generation loss: Quality reduction from repeated lossy encoding.
Review questions
- Why does a
.wavextension not guarantee that an embedded DSP can play the file? - What is the difference between FLAC and MP3 compression?
- Why should a lossy file not be used as the long-term production master?
Answers
-
WAV is a container. The enclosed codec, sample rate, bit depth, channel count and file size may exceed what the DSP supports.
-
FLAC is lossless and reconstructs the original samples. MP3 is lossy and permanently removes information.
-
Each later lossy transcode can discard more information. A PCM or lossless master preserves the source for future deliverables.
Discuss a project