Open-Source Codecs (Part 1: Audio)

Open-Source Codecs  (Part 1: Audio)
Open-Source Codecs

 (Part 1: Audio)

Table of Contents 

What a Codec Actually Does 

The Lossless Camp: FLAC and WavPack 

The Lossy Camp: Opus, Vorbis, and MP3's Long Road to Freedom 

Codecs in Daily Life Across Linux, BSD, and Unix


Every time you rip a CD, join a video call, stream a podcast on the bus, or export a voice memo, a codec is quietly doing the heavy lifting. Codecs are one of those unglamorous technologies that shape almost everything we hear online, yet most people never give them a second thought until a file refuses to play or a call sounds like it is coming from the bottom of a well. For the open-source world, audio codecs carry an extra layer of importance: they decide whether your music library, your podcast archive, or your internet telephony stack depends on a royalty-bearing format controlled by a corporation, or on a format that anyone, anywhere, can implement, inspect, and improve without asking permission. This first instalment looks at the audio side of that story. A companion piece will cover video separately, since doing justice to both halves of the codec world properly needs room to breathe.


What a Codec Actually Does

The word "codec" is a portmanteau of coder and decoder, and that is genuinely all it is: a piece of software (occasionally hardware) that squeezes audio data down into a smaller stream for storage or transmission, and then expands it back out again for playback. It is worth separating this from a container format, since the two get muddled constantly. A container, such as Ogg, Matroska, or WAV, is simply an envelope that holds one or more encoded streams along with metadata like chapter markers or album art. The codec is what actually determines how the raw sound waves are turned into bits and back again. You can, for instance, put an Opus stream inside an Ogg container, a Matroska container, or a WebM container, and the audio itself is identical in each case; only the wrapper changes.


Audio codecs split broadly into two families. Lossless codecs compress a file the way a zip archive compresses a document: nothing is thrown away, and decompressing the file returns you to bit-for-bit the same audio you started with. This matters enormously for archiving, mastering, and any situation where you might want to re-edit or re-encode the material later without compounding quality loss. Lossy codecs, on the other hand, use psychoacoustic modelling to work out which parts of a sound a human ear is unlikely to notice missing, and they discard that information permanently in exchange for a much smaller file. Neither approach is "better" in absolute terms; they simply solve different problems, and the open-source audio ecosystem has produced excellent, patent-unencumbered options in both categories.


The other thing worth understanding early on is licensing, because it explains why open formats matter so much to distribution maintainers specifically. A codec that is merely "free to download" is not the same as a codec that is free of patent obligations. Distributions that care about strict software freedom, and downstream packagers who cannot risk legal exposure, have historically had to tread carefully around codecs whose underlying algorithms were covered by patents, even when a working implementation existed. Codecs published by bodies with an explicit royalty-free patent commitment remove that headache entirely, which is a large part of why organisations like the Xiph.Org Foundation and the Internet Engineering Task Force loom so large in this story.


It also helps to have a rough sense of the vocabulary that follows an audio file around: sample rate, the number of times per second the original analogue waveform was measured, typically 44,100 or 48,000 times for everyday listening; bit depth, how finely each of those measurements is stored, commonly 16 or 24 bits; and bitrate, how much data per second the compressed stream actually uses once a codec has done its work. Lossless codecs generally report a variable bitrate that depends entirely on how complex the source material is, since silence compresses far more than a dense orchestral passage, while lossy codecs are usually described by a target bitrate that the encoder tries to hit, trading fidelity for file size as that number moves up or down.


The Lossless Camp: FLAC and WavPack

FLAC, the Free Lossless Audio Codec, is the closest thing the open-source audio world has to a default answer for lossless archiving. Development began in 2000 under Josh Coalson, and stewardship passed to the Xiph.Org Foundation, which continues to maintain it today. According to Xiph's own project page, FLAC is the fastest and most widely supported lossless audio codec, and crucially it is the only one that is simultaneously non-proprietary, unencumbered by patents, backed by an open-source reference implementation, documented to a well-specified format and API, and supported by multiple independent implementations rather than a single official one. The codec libraries, libFLAC and libFLAC++, are distributed under Xiph's permissive BSD-style licence, while the command-line utilities that ship alongside them are released under the GNU General Public License, so both commercial hardware vendors and free-software purists can build on it comfortably.


FLAC typically compresses audio down to somewhere between half and seventy per cent of its original size, depending on the source material, and because nothing is discarded, decoding always returns an identical copy of the original waveform. The project reached a genuine milestone in December 2024, when the FLAC bitstream format was formally published as an Internet Standards Track document, RFC 9639, by the IETF. That gave FLAC the kind of independent, vendor-neutral specification that had previously existed only informally, and it followed shortly afterwards by the release of FLAC 1.5.0 in February 2025, the most recent stable version of the reference tools at the time of writing. If you rip CDs, back up vinyl transfers, or simply want a format that will still be readable in twenty years without a licensing negotiation, FLAC remains the sensible default across every major Linux distribution, the BSDs, and beyond.


WavPack takes a slightly different, and rather clever, approach. Rather than forcing a binary choice between lossless and lossy, WavPack offers a genuine hybrid mode: it produces a smaller lossy file for everyday listening alongside a separate, optional correction file that, when combined with the lossy file, reconstructs the original audio exactly, bit for bit. This is a neat trick for anyone juggling limited storage on a portable device while still wanting a perfect archival copy sitting alongside it. According to the WavPack project's own documentation, the format also supports an unusually wide range of source material, including Direct Stream Digital audio as used on Super Audio CDs, multichannel and high-resolution PCM up to 32-bit floating point, and a variety of container wrapping options. WavPack is released under a permissive BSD licence, with third-party support already built into tools such as FFmpeg, and it remains a strong choice for anyone with an unusually demanding archiving workflow that plain FLAC does not quite cover.


Under the bonnet, both formats lean on broadly similar ideas even though their feature sets diverge. FLAC works by predicting each audio sample from the ones before it, using linear prediction, and then encoding only the small difference between the prediction and the actual value using an efficient entropy coder based on Rice coding, which is why silent or repetitive passages shrink dramatically while dense, busy material shrinks far less. This is also why lossless compression ratios are always described as a range rather than a fixed number: they depend entirely on how predictable the source material is, not on any setting the user controls. WavPack applies a related but more flexible prediction scheme across its lossless, lossy, and hybrid modes, and its correction-file mechanism works by storing exactly the residual information that the lossy pass discarded, so that adding the correction file back to the lossy file mathematically reconstructs the original bit-for-bit, rather than simply approximating it more closely.


The Lossy Camp: Opus, Vorbis, and MP3's Long Road to Freedom

If FLAC is the default for lossless work, Opus is rapidly becoming the default for almost everything else. Standardised by the IETF as RFC 6716, Opus was built by combining Skype's SILK codec, designed for speech, with Xiph.Org's CELT codec, designed for general audio, into a single format that scales gracefully from narrowband voice calls to full-bandwidth stereo music. The Opus project describes it as a totally open, royalty-free, and highly versatile codec, equally suited to voice-over-IP, videoconferencing, in-game chat, live remote music performance, and ordinary music storage and streaming. That versatility is unusual: most codecs are optimised for either speech or music, not both, and Opus manages to be genuinely competitive at each end of that spectrum without compromise. Decoding support is now built into every major browser, and the reference library, libopus, continues to see active development, with version 1.6 released towards the end of 2025 bringing further quality refinements.


Vorbis, Opus's older sibling from the same Xiph.Org stable, was the format that first proved a fully open, patent-unencumbered lossy codec could go toe-to-toe with proprietary alternatives. According to the Vorbis project's own documentation, the specification belongs to the public domain, meaning any software can implement it fully without licence fees, royalties, or patent concerns of any kind. Most commonly encountered wrapped inside an Ogg container as "Ogg Vorbis," it became a mainstay of open-source media players, internet radio streaming through Icecast, and countless video games, precisely because developers could ship it without a legal department getting involved. Opus has, in most modern use cases, overtaken Vorbis on pure technical merit, but Vorbis remains widely deployed in legacy software, game engines, and any pipeline where switching formats simply is not worth the disruption.


Part of what makes Opus so adaptable is the way it internally switches between two rather different coding techniques depending on what it is being asked to compress. The SILK component it inherited from Skype is well suited to speech, modelling the human vocal tract efficiently at low bitrates, while the CELT component contributed by Xiph.Org is a transform-based coder better suited to music and general audio at higher quality settings. Opus can blend or switch between the two, or use a hybrid mode that covers both simultaneously across different frequency bands, which is precisely why the same codec can sound clear on a patchy mobile voice call at 6 kilobits per second and also serve as a perfectly respectable music format at 128 kilobits per second and above. It is worth mentioning, too, that Xiph.Org also developed Speex specifically as an earlier open speech codec, but the project's own documentation now describes Opus as rendering Speex obsolete on essentially every technical measure, which is why Speex today survives mainly in legacy voice-over-IP deployments rather than new projects.


No honest account of open audio codecs can skip over MP3, even though it began life as anything but open. MPEG-1 Audio Layer III was developed by the Fraunhofer Institute for Integrated Circuits in Germany, building on earlier research from the University of Erlangen-Nuremberg, and for two decades it sat behind a thicket of patent licensing that made it awkward for free-software projects to distribute encoders and decoders with a clear conscience. That changed on 23 April 2017, when Fraunhofer and Technicolor jointly announced, on Fraunhofer's own MP3 pages, that their licensing programme for MP3-related patents and software had been terminated, following the expiry of the last relevant patents in the family. Fraunhofer was careful to point out that this was not the format "dying," simply the end of an era in which implementers had to pay for the privilege of using it. In practical terms for the open-source community, it meant that the long-standing LAME encoder, whose developers had never licensed the underlying patents in the first place, could finally be distributed and bundled without legal ambiguity anywhere those patents had previously applied. Most Linux distributions now happily include MP3 encoding and decoding support out of the box, something that would have required a separate, sometimes awkward, installation step in earlier years.


Codecs in Daily Life Across Linux, BSD, and Unix

Theory is all well and good, but where do these codecs actually show up for the person sitting at a terminal or a desktop? FFmpeg, the free command-line multimedia framework, is arguably the single piece of software doing more than any other to make open codecs practically usable, since its libavcodec library provides working implementations of FLAC, Opus, Vorbis, WavPack, MP3, and dozens of others, all accessible through a consistent interface used by everything from desktop video editors to headless media servers. If you have ever used a graphical audio converter, a podcast app, or a self-hosted streaming server on any Unix-like system, there is a very good chance FFmpeg was doing the actual codec work underneath it.


At the desktop level, GStreamer and its plugin ecosystem perform a similar unifying role for GNOME, many multimedia players, and a good number of embedded Linux systems, while PipeWire, now the default audio and video routing layer on most contemporary Linux desktops, treats codec support as a plugin concern rather than something baked into the core, which keeps the system flexible as formats evolve. On the BSD side, FreeBSD, OpenBSD, and NetBSD all ship FFmpeg, the Xiph libraries, and Opus through their respective ports and package collections, so audio codec support there is every bit as comprehensive as on Linux, just delivered through a different packaging philosophy. Independent and niche distributions, including many of the smaller, community-run projects that populate distribution trackers such as DistroWatch, typically inherit this same codec stack wholesale from the upstream libraries rather than reinventing anything, which is precisely the benefit of a shared, well-tested open ecosystem: one good implementation genuinely does serve everybody downstream.


For voice and video conferencing specifically, Opus has become close to universal. It is the default or mandatory-to-implement audio codec behind WebRTC, which underpins a huge share of open-source and commercial calling tools alike, from Jitsi Meet to browser-based conferencing built directly into Firefox and Chromium. For music playback and personal libraries, FLAC has become the conservative, safe choice for anyone ripping physical media, while Opus increasingly handles everything downstream of that for portable listening, streaming, and voice notes, having largely eclipsed both MP3 and Vorbis for new lossy encoding work on the strength of its efficiency at low bitrates. None of this requires a user to think about licensing at all in day-to-day use; the point of these formats being genuinely open is that the legal groundwork has already been done, once, upstream, so that everybody building or packaging software downstream can simply get on with it.


There is also a quieter, accessibility-focused angle to this story worth a mention. Screen readers and text-to-speech systems on Linux, such as those built on the Speech Dispatcher framework, and voice assistants running locally on privacy-conscious setups, generally lean on the same open codec stack rather than a proprietary one, since a system that cannot be certain what licensing terms apply to its own audio pipeline is a poor fit for software meant to run everywhere from a budget single-board computer to a fully kitted-out workstation. The same applies to embedded and hobbyist hardware: projects built around Raspberry Pi boards, open firmware audio players, and DIY home automation speakers overwhelmingly rely on FFmpeg, the Xiph libraries, or Opus directly, precisely because there is no licence negotiation standing between a hardware hobbyist and a working audio pipeline.


It is also worth noting how these formats interact with the container choices covered more fully in part two. Opus and Vorbis are most naturally carried inside Ogg, the native Xiph.Org container, but both are equally at home inside Matroska, and Opus in particular is commonly embedded inside WebM alongside VP9 or AV1 video for online streaming. FLAC and WavPack, being aimed squarely at archiving rather than streaming, are typically distributed as standalone files or embedded inside Matroska when bundled with accompanying video, rather than wrapped in a lightweight streaming container designed for a different job entirely. Picking the right codec, in other words, is only half the decision; the container it travels in shapes how easily that file plays back, seeks, and carries metadata once it leaves your machine.


That is audio squared away. Video, unsurprisingly, is a considerably bigger and more contested field, with its own alliance of tech giants, its own generational rivalry between formats, and its own set of hardware acceleration quirks that audio has never really had to worry about. The second instalment of this series picks up exactly there.


Conclusion

Open-source audio codecs have quietly become the unglamorous backbone of modern digital sound, from the lossless archives kept by careful collectors to the Opus streams carrying millions of daily voice calls. What ties FLAC, WavPack, Vorbis, and Opus together is not just technical merit, though each holds its own comfortably against proprietary rivals, but the deliberate, patient work of organisations like Xiph.Org and the IETF in making sure nobody ever has to ask permission to use them. MP3's long and slightly awkward journey to patent freedom is a useful reminder of how much friction openness actually removes. Part two turns to the video side of the story, where the stakes, and the politics, get considerably higher.


Disclaimer

All product names, logos, and trademarks mentioned in this article, including FLAC, WavPack, Opus, Vorbis, MP3, and the names of their respective projects and maintaining organisations, are the property of their respective owners and are used here for identification and informational purposes only. No endorsement or affiliation is implied. Every effort has been made to verify accuracy at the time of writing using official project sources, though software projects evolve constantly and readers should confirm current details with the relevant official channels before making technical decisions. The Distrowrite Project does not endorse, promote, or condone the use of any codec, tool, or piece of software in connection with malware, unauthorised access, or any activity intended to compromise the integrity, security, or availability of networks, devices, or other digital infrastructure.


References 


✩♬ ₊̊.🎧⋆☾⋆⁺₊✧

Comments