{"id":13439561,"url":"https://github.com/xiph/flac","last_synced_at":"2025-05-14T04:00:32.930Z","repository":{"id":19836399,"uuid":"23097875","full_name":"xiph/flac","owner":"xiph","description":"Free Lossless Audio Codec","archived":false,"fork":false,"pushed_at":"2025-03-16T18:54:06.000Z","size":9951,"stargazers_count":1889,"open_issues_count":47,"forks_count":301,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-04-10T20:55:41.040Z","etag":null,"topics":["audio","c","decoding","encoding","lossless","lossless-compression-algorithm"],"latest_commit_sha":null,"homepage":"https://xiph.org/flac/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gfdl-1.3","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiph.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING.FDL","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-19T05:20:50.000Z","updated_at":"2025-04-10T10:31:32.000Z","dependencies_parsed_at":"2023-02-18T04:16:09.178Z","dependency_job_id":"15160fb0-15a7-4e55-bf7b-fa7557d28bb8","html_url":"https://github.com/xiph/flac","commit_stats":{"total_commits":4519,"total_committers":120,"mean_commits":37.65833333333333,"dds":"0.36202699712325737","last_synced_commit":"d1d72aa77cfeb71357b59411f981ff52ac1a1f60"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiph%2Fflac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiph%2Fflac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiph%2Fflac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiph%2Fflac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiph","download_url":"https://codeload.github.com/xiph/flac/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254067085,"owners_count":22009074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","c","decoding","encoding","lossless","lossless-compression-algorithm"],"created_at":"2024-07-31T03:01:15.140Z","updated_at":"2025-05-14T04:00:32.875Z","avatar_url":"https://github.com/xiph.png","language":"C","readme":"\u003c!---\n/* FLAC - Free Lossless Audio Codec\n * Copyright (C) 2001-2009  Josh Coalson\n * Copyright (C) 2011-2025  Xiph.Org Foundation\n *\n * This file is part the FLAC project.  FLAC is comprised of several\n * components distributed under different licenses.  The codec libraries\n * are distributed under Xiph.Org's BSD-like license (see the file\n * COPYING.Xiph in this distribution).  All other programs, libraries, and\n * plugins are distributed under the LGPL or GPL (see COPYING.LGPL and\n * COPYING.GPL).  The documentation is distributed under the Gnu FDL (see\n * COPYING.FDL).  Each file in the FLAC distribution contains at the top the\n * terms under which it may be distributed.\n *\n * Since this particular file is relevant to all components of FLAC,\n * it may be distributed under the Xiph.Org license, which is the least\n * restrictive of those mentioned above.  See the file COPYING.Xiph in this\n * distribution.\n */\n---\u003e\n\n# Free Lossless Audio Codec (FLAC)\n\nFLAC is open source software that can reduce the amount of storage space\nneeded to store digital audio signals without needing to remove\ninformation in doing so.\n\nThe files read and produced by this software are called FLAC files. As\nthese files (which follow the [FLAC format](https://xiph.org/flac/format.html))\ncan be read from and written to by other software as well, this software\nis often referred to as the FLAC reference implementation.\n\nFLAC has been developed by volunteers. If you want to help out, see\nCONTRIBUTING.md for more information.\n\n## Components\n\nFLAC is comprised of\n  * libFLAC, a library which implements reference encoders and\n    decoders for native FLAC and Ogg FLAC, and a metadata interface\n  * libFLAC++, a C++ object wrapper library around libFLAC\n  * `flac`, a command-line program for encoding and decoding files\n  * `metaflac`, a command-line program for viewing and editing FLAC\n    metadata\n  * user and API documentation\n\nThe libraries (libFLAC, libFLAC++) are licensed under Xiph.org's\nBSD-like license (see COPYING.Xiph). All other programs and plugins are\nlicensed under the GNU General Public License (see COPYING.GPL). The\ndocumentation is licensed under the GNU Free Documentation License\n(see COPYING.FDL).\n\n## Documentation\n\nFor documentation of the `flac` and `metaflac` command line tools, see\nthe directory man, which contains the files flac.md and metaflac.md\n\nThe API documentation is in html and is generated by Doxygen. It can be\nfound in the directory doc/html/api. It is included in a release tarball\nand must be build with Doxygen when the source is taken directly from\ngit.\n\nThe directory examples contains example source code on using libFLAC and\nlibFLAC++.\n\nDocumentation concerning the FLAC format itself (which can be used to\ncreate software reading and writing FLAC software independent from\nlibFLAC) was included in previous releases, but can now be found on\nhttps://datatracker.ietf.org/doc/draft-ietf-cellar-flac/ Additionally\na set of files for conformance testing called the FLAC decoder testbench\ncan be found at https://github.com/ietf-wg-cellar/flac-test-files\n\nIf you have questions about FLAC that this document does not answer,\nplease submit them at the following tracker so this document can be\nimproved:\n\nhttps://github.com/xiph/flac/issues\n\n## Building FLAC\n\nAll components of the FLAC project can be build with a variety of\ncompilers (including GCC, Clang, Visual Studio, Intel C++ Compiler) on\nmany architectures (inluding x86, x86_64, ARMv7, ARMv8 and PowerPC)\nfor many different operating systems.\n\nTo do this, FLAC provides two build systems: one using GNU's autotools\nand one with CMake. Both differ slighly in configuration options, but\nshould be considered equivalent for most use cases.\n\nFLAC used to provide files specifically for building with Visual Studio,\nbut these have been removed in favor of using CMake.\n\n## Building with CMake\n\nCMake is a cross-platform build system. FLAC can be built on Windows,\nLinux, Mac OS X using CMake.\n\nYou can use either CMake's CLI or GUI. We recommend you to have a\nseparate build folder outside the repository in order to not spoil it\nwith generated files. It is possible however to do a so-called in-tree\nbuild, in that case /path/to/flac-build in the following examples is\nequal to /path/to/flac-source.\n\n### CMake CLI\n\nGo to your build folder and run something like this:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source\n```\n\nor e.g. in Windows shell\n\n```\nC:\\path\\to\\flac-build\u003e cmake \\path\\to\\flac-source\n```\n\n(provided that cmake is in your %PATH% variable)\n\nThat will generate build scripts for the default build system (e.g.\nMakefiles for UNIX). After that you start build with a command like\nthis:\n\n```\n/path/to/flac-build$ make\n```\n\nAnd afterwards you can run tests or install the built libraries and\nheaders\n\n```\n/path/to/flac-build$ make test\n/path/to/flac-build$ make install\n```\n\nIf you want use a build system other than default add -G flag to cmake,\ne.g.:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source -GNinja\n/path/to/flac-build$ ninja\n```\n\nor:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source -GXcode\n```\n\nUse cmake --help to see the list of available generators.\n\nBy default CMake will search for OGG. If CMake fails to find it you can\nhelp CMake by specifying the exact path:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source -DOGG_ROOT=/path/to/ogg\n```\n\nIf you would like CMake to build OGG alongside FLAC, you can place the\nogg sources directly in the flac source directory as a subdirectory with\nthe name ogg, for example:\n\n```\n/path/to/flac-source/ogg\n```\n\nIf you don't want to build flac with OGG support you can tell CMake not\nto look for OGG:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source -DWITH_OGG=OFF\n```\n\nOther FLAC's options (e.g. building C++ lib or docs) can also be put to\ncmake through -D flag. If you want to know what options are available,\nuse -LH:\n\n```\n/path/to/flac-build$ cmake /path/to/flac-source -LH\n```\n\n### CMake GUI (for Visual Studio)\nIt is likely that you would prefer to use the CMake GUI if you use\nVisual Studio to build FLAC. It's in essence the same process as\nbuilding using CLI.\n\nOpen cmake-gui. In the window select a source directory (the\nrepository's root), a build directory (some other directory outside the\nrepository). Then press button \"Configure\". CMake will ask you which\nbuild system you prefer. Choose that version of Visual Studio which you\nhave on your system, choose whether you want to build for Win32 or x64.\nPress OK.\n\nAfter CMake finishes you can change the configuration to your liking and\nif you change anything, run Configure again. With the \"Generate\" button,\nCMake creates Visual Studio files, which can be opened from Visual\nStudio. With the button \"Open Project\" CMake will launch Visual Studio\nand open the generated solution. You can use the project files as usual\nbut remember that they were generated by CMake. That means that your\nchanges (e.g. some additional compile flags) will be lost when you run\nCMake next time.\n\nCMake searches by default for OGG on your system and returns an error\nif it cannot find it. If you want to build OGG alongside FLAC, you can\ndownload the OGG sources and extract them in a subdirectory of the FLAC\nsource directory with the name ogg (i.e. /path/to/flac-source/ogg)\nbefore running CMake. If you don't want to build FLAC with OGG support,\nuntick the box following WITH_OGG flag in the list of variables in\ncmake-gui window and run \"Configure\" again.\n\nIf CMake fails to find MSVC compiler then running cmake-gui from MS\nDeveloper comand prompt should help.\n\n## Building with GNU autotools\n\nFLAC uses autoconf and libtool for configuring and building. To\nconfigure a build, open a commmand line/terminal and run `./configure`\nYou can provide options to this command, which are listed by running\n`./configure --help`.\n\nIn case the configure script is not present (for example when building\nfrom git and not from a release tarball), it can be generated by running\n`./autogen.sh`. This may require a libtool development package though.\n\nAfter configuration, build with `make`, verify the build with\n`make check` and install with `make install`. Installation might require\nadministrator priviledged, i.e. `sudo make install`.\n\nThe 'make check' step is optional; omit it to skip all the tests, which\ncan take about an hour to complete. Even though it will stop with an\nexplicit message on any failure, it does print out a lot of stuff so you\nmight want to capture the output to a file if you're having a problem.\nAlso, don't run 'make check' as root because it confuses some of the\ntests.\n\nSummarizing:\n\n```\n./configure\nmake \u0026\u0026 make check\nsudo make install\n```\n\n## Note to embedded developers\n\nlibFLAC has grown larger over time as more functionality has been\nincluded, but much of it may be unnecessary for a particular embedded\nimplementation.  Unused parts may be pruned by some simple editing of\nconfigure.ac and src/libFLAC/Makefile.am; the following dependency\ngraph shows which modules may be pruned without breaking things\nfurther down:\n\n```\nmetadata.h\n    stream_decoder.h\n    format.h\n\nstream_encoder.h\n    stream_decoder.h\n    format.h\n\nstream_decoder.h\n    format.h\n```\n\nIn other words, for pure decoding applications, both the stream encoder\nand metadata editing interfaces can be safely removed. Note that this\nis specific to building the libraries for embedded use. The command line\ntools do not provide such compartmentalization, and require a complete\nlibFLAC build to function.\n\nThere is a section dedicated to embedded use in the libFLAC API\nHTML documentation (see doc/html/api/index.html).\n\nAlso, there are several places in the libFLAC code with comments marked\nwith \"OPT:\" where a #define can be changed to enable code that might be\nfaster on a specific platform.  Experimenting with these can yield\nfaster binaries.\n","funding_links":[],"categories":["C","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiph%2Fflac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiph%2Fflac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiph%2Fflac/lists"}