CLI tool
xiph/flac avatar
xiph/flac

flac: four licence files, one recorded licence, and two build systems that differ slightly

Free Lossless Audio Codec

2,480 stars391 forksCGFDL-1.3

At a glance

What is it?
The reference implementation of the FLAC codec, shipping libFLAC, a C++ wrapper, two command line tools and its own documentation, each under a different licence, with both autotools and CMake supported. The build instructions, the Ogg lookup order and the per file licence headers are where it explains itself.
Who is it for?
Use FLAC when you need a lossless codec with a reference implementation you can audit, either through the command line tools or by linking libFLAC directly, and when being able to read each file's own licence header matters to you. Three things to check first.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 18 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • xiph/flac2,480 ★ · +59
Star history
Repository2026-09-302026-11-15
xiph/flac2.4k2.5k

59 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Four COPYING files, and the metadata names one of them

The distribution is split across four licences and says so in a header at the top of its own source files. The codec libraries are under Xiph.Org's BSD-like licence, named COPYING.Xiph. All other programs, libraries and plugins are under the LGPL or GPL, named COPYING.LGPL and COPYING.GPL. The documentation is under the GNU Free Documentation Licence, named COPYING.FDL. The header also states that each file in the distribution carries at the top the terms under which it may be distributed, so the authoritative answer for any given file is in that file. The recorded project licence, though, is the documentation one. If you are clearing dependencies with a scanner, that single label describes the manual rather than the code you will be linking.

Two build systems, and the note that they are not identical

FLAC provides two build systems, one using GNU autotools and one with CMake, and the documentation says they differ slighly in configuration options while being equivalent for most use cases. Autotools means configure.ac, Makefile.am files, an autogen.sh, an m4 directory for macros and a generated configure. CMake means a top level CMakeLists.txt, a cmake directory, config.cmake.h.in and flac-config.cmake.in for the installed package config. The CMake route looks like this, run from an empty build folder kept outside the repository:

bash
/path/to/flac-build$ cmake /path/to/flac-source
/path/to/flac-build$ make

The compiler list is broad, GCC, Clang, Visual Studio and the Intel C++ Compiler, across x86, x86_64, ARMv7, ARMv8 and PowerPC.

The Visual Studio project files were removed deliberately

One sentence explains a change that would otherwise look like a missing feature: FLAC used to provide files specifically for building with Visual Studio, and these have been removed in favor of using CMake. So a Visual Studio user goes through cmake-gui or the command line. The GUI route is documented in detail: open cmake-gui, pick the repository root as the source directory, pick a build directory outside the repository, press Configure, choose which Visual Studio version is installed and whether to build Win32 or x64, then Generate to produce the files and Open Project to launch Visual Studio on the solution. An in-tree build is possible too, the documentation says, with the build directory equal to the source directory.

Edits to generated project files do not survive a regenerate

The Visual Studio section ends with a warning that is easy to skim past. The generated project files can be used as usual, but they were generated by CMake, so changes to them, and the example given is adding compile flags, will be lost when CMake regenerates. That is the general hazard of a generated IDE project stated in the project's own documentation rather than discovered later. The mitigation is the one the GUI section already sets up: keep the build directory outside the repository and put any real build configuration through CMake options. The way to see what is available is cmake with the -LH flag from the build directory, which prints the cache variables including the ones specific to FLAC.

Ogg can be found four different ways or switched off

Ogg support is optional and the CMake build has four documented routes for it. By default CMake searches for Ogg. If the search fails, you can hand it the exact location with the OGG_ROOT definition pointing at the Ogg directory. If you would rather build Ogg alongside FLAC, the instruction is to place the Ogg sources directly in the FLAC source directory as a subdirectory with the name ogg. And if you do not want Ogg at all, there is a WITH_OGG switch set to OFF. The rest of the build follows the familiar shape: run cmake on the source directory from an empty build folder, then make, then make test and make install, or select a different generator such as Ninja or Xcode with the -G flag.

The format specification moved out of the release

The documentation section splits the documentation into four places with different audiences. Man pages for the two command line tools are in the man directory as flac.md and metaflac.md. API documentation is generated by Doxygen into doc/html/api, and it is included in a release tarball but has to be build with Doxygen when you take the source directly from git. Example source for both libFLAC and libFLAC++ is in examples, which the tree splits into c and cpp directories. And the format specification itself, the document you need in order to write software that reads and writes FLAC without using libFLAC, was included in previous releases but can now be found on the IETF datatracker as the cellar draft, with a decoder testbench file set in the ietf-wg-cellar flac-test-files repository.

Three CI configurations, one of them from the Travis era

The top level holds three sets of build configuration. There is a .github directory, a .gitlab-ci.yml file and a .travis.yml file. Having Travis configuration alongside GitHub and GitLab ones means the project has carried more than one continuous integration service across its history, and the Travis file is the kind that usually survives from a period when it was the only option worth having. There is also an oss-fuzz directory, which places the project in a fuzzing corpus, and a test directory that the CMake build reaches through make test. Nothing in the documentation says which configuration is authoritative, so a contributor adding a job has to pick one.

The prose carries a run of small errors

The documentation is written in plain, informal English and has a visible trail of typos in it. The header says this file is part the FLAC project, missing the preposition. The build section says all components can be build with a variety of compilers, and the API documentation must be build with Doxygen, both using build where built is meant. One sentence lists architectures as inluding x86, and another says the two build systems differ slighly. None of these change what the code does, but they are the kind of detail that makes a new reader wonder whether the surrounding sentences were checked, and they are the one part of this project where the writing quality is uneven rather than merely terse.

Editorial conclusion

Use FLAC when you need a lossless codec with a reference implementation you can audit, either through the command line tools or by linking libFLAC directly, and when being able to read each file's own licence header matters to you. Three things to check first. The project is deliberately multi-licensed, with four COPYING files and a header on every source file, so do not carry a single licence label into your own distribution. Two build systems are supported and they are stated to differ slightly in configuration options, so a flag that works under autotools may not exist under CMake. And the format specification is no longer shipped with releases, so read the IETF cellar draft rather than the documentation directory for anything about the bitstream itself.

Frequently asked questions

What components does the FLAC project ship?

libFLAC with reference encoders and decoders for native FLAC and Ogg FLAC plus a metadata interface, libFLAC++ as a C++ object wrapper, the flac command line program, metaflac for viewing and editing metadata, and the user and API documentation.

How do I build FLAC from source?

Two build systems are provided, autotools and CMake, which the documentation says differ slightly in configuration options. With CMake, run cmake against the source directory from a separate build folder, then make, followed by make test and make install.

What licences apply to FLAC?

The codec libraries are under Xiph.Org's BSD-like licence, the other programs, libraries and plugins under the LGPL or GPL, and the documentation under the GNU Free Documentation Licence. Each file in the distribution carries the terms it may be distributed under at the top of the file.

Where is the FLAC format specification?

It is no longer included in releases. It is published as an IETF cellar draft on the IETF datatracker, with a set of decoder testbench files in the ietf-wg-cellar flac-test-files repository.

Does FLAC still ship Visual Studio project files?

No. Files specifically for building with Visual Studio were removed in favour of CMake. Windows builds go through cmake-gui or the CMake command line, and changes made to the generated project files are lost when CMake regenerates them.

What are the Ogg options in the FLAC CMake build?

CMake searches for Ogg by default. If that fails you can pass an OGG_ROOT definition with the exact path, or place the Ogg sources in the FLAC source directory as a subdirectory named ogg, or disable the support by setting WITH_OGG to OFF.

Official sources

  1. License: GFDL-1.3
  2. Project website
  3. README
  4. Releases
  5. xiph/flac on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/xiph-flac.svg)](https://hysenlabs.com/projects/xiph-flac)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/xiph-flac.svg)](https://hysenlabs.com/projects/xiph-flac)

Was this useful?