FLAC (/flæk/; Free Lossless Audio Codec) is an audio coding format for lossless compression of digital audio, developed by the Xiph.Org Foundation, and is also the name of the free software project producing the FLAC tools, the reference software package that includes a codec implementation. Digital audio compressed by FLAC's algorithm can typically be reduced to between 50 and 70 percent of its original size[4] and decompresses to an identical copy of the original audio data.
The encoded audio is divided into frames, which consists of a header, a data block, and a CRC16 checksum. Each frame is encoded independent of each other. A frame header begins with a sync word, used to identify the beginning of a valid frame. The rest of the header contains the number of samples, position of the frame, channel assignment, and optionally the sample rate and bit depth. The data block contains the audio information.[10]
Metadata in FLAC precedes the audio. Properties like the sample rate and the number of channels are always contained in the metadata. It may also contain other information, the album cover for example.[10] FLAC uses Vorbis comments for textual metadata like track title and artist name.
The FLAC encoding algorithm consists of multiple stages. In the first stage, the input audio is split into blocks. If the audio contains multiple channels, each channel is encoded separately as a subblock. The encoder then tries to find a good mathematical approximation of the block, either by fitting a simple polynomial, or through general linear predictive coding. A description of the approximation, which is only a few bytes in length, is then written. Finally, the difference between the approximation and the input, called residual, is encoded using Rice coding. In many cases, a description of the approximation and the encoded residual takes up less space than using pulse-code modulation.[10]
For two-channel stereo, the encoder may choose to joint-encode the audio. The channels are transformed into a side channel, which is the difference between the two input channels, and a mid channel, the sum of the two input channels. In place of a mid channel, the left channel or the right channel may be encoded instead, which is sometimes more space-efficient.[15]
Alongside the format, the FLAC project also contains a free and open-source reference implementation of FLAC called libFLAC. libFLAC contains facilities to encode and decode FLAC data and to manipulate the metadata of FLAC files. libFLAC++, an object-oriented wrapper around libFLAC for C++, and the command-line programs flac and metaflac, are also part of the reference implementation.
Since FLAC is a lossless scheme, it is suitable as an archive format for owners of CDs and other media who wish to preserve their audio collections. If the original media are lost, damaged, or worn out, a FLAC copy of the audio tracks ensures that an exact duplicate of the original data can be recovered at any time. An exact restoration from a lossy copy (e.g., MP3) of the same data is impossible. FLAC's being lossless means it is highly suitable for transcoding e.g. to MP3, without the normally associated transcoding quality loss between one lossy format and another. A CUE file can optionally be created when ripping a CD. If a CD is read and ripped perfectly to FLAC files, the CUE file allows later burning of an audio CD that is identical in audio data to the original CD, including track order and pregap, but excluding CD-Text and other additional data such as lyrics and CD+G graphics.[19]
The reference implementation of FLAC is implemented as the libFLAC core encoder & decoder library, with the main distributable program flac being the reference implementation of the libFLAC API. This codec API is also available in C++ as libFLAC++. The reference implementation of FLAC compiles on many platforms, including most Unix (such as Solaris, BSD) and Unix-like (including Linux), Microsoft Windows, BeOS, and OS/2 operating systems. There are build-systems for autoconf/automake, MSVC, Watcom C, and Xcode. There is currently no multicore support in libFLAC, but utilities such as GNU parallel and various graphical frontends can be used to spin up multiple instances of the encoder.
FLAC playback support in portable audio devices and dedicated audio systems is limited compared to formats such as MP3[20] or uncompressed PCM. FLAC support is included by default in Windows 10, Android, BlackBerry 10 and Jolla devices.
The European Broadcasting Union (EBU) has adopted the FLAC format for the distribution of high quality audio over its Euroradio network.[21] The Windows operating system has supported native FLAC integration since the introduction of Windows 10.[22] The Android operating system has supported native FLAC playback since version 3.1.[23][24] macOS High Sierra and iOS 11 add native FLAC playback support.[25]
7digital is a music streaming service providing more than 80 million tracks in MAQ, MP3, M4A, 16-bit and 32-bit FLAC audio. You can explore music by hi-res/FLAC, new albums, new tracks, charts and genre. 7digital is available in 82 countries.
I originally have a FLAC file that I subtitled and want to add the audio to an mp4 video without losing audio quality. I've tried encoding it with handbrake but the file turns out too large and the audio quality is not on par to the FLAC file.
Please forgive my ignorance, but I just read some articles that seems to prove that uncompressed audio formats sounds better than compressed lossless formats.
So far, I knew that flac is an lossless audio extension and therefore any data that is stored in a .flac file is equivalent to any uncompressed lossless audio file. Most of my music is in flac format as I store no uncompressed audio files while I maintain some CBR 320 mp3s if I cannot get my hands on transparent lossless audio version of a track.
As a truly ignorant friend of mine argued about flac fidelity as it shaves frequencies similar to mp3s, I tried to search for some scientific data that proves him wrong. However, I fell into those two articles that proves me wrong!
Those two articles argue about the transparency of flac audio and after measurements seems to prove that there is noticeable difference between wav and flac. Those two articles focus on different aspects which (if true) proves that flacs are inappropriate for true audio representation.
Can someone spare the time and explain to me what is going on? Isn't flac just pure lossless audio that can be converted to any audio format without data degradation? Does truly metadata info affects audio performance and does converting files between lossless audio formats degrades the output fidelity?
I bought some music online and downloaded it in FLAC format, and I was pleasantly surprised to see some artwork apparently embedded into each audio file. I suspect that they're a bit higher resolution than Windows' "Extra large icons" preview, so is there a way to extract them into their own files?
Not sure if this is still on the topic, but I first found this thread while searching info on the same task, and than found another easy and free solution: the foobar2000 media player, which, AFAIK, manages .flac out of the box, allows exporting embedded artwork.
I used Audacity 3.2.5 to create a two-track audio file for testing purposes and exported it to FLAC and mp3 within Audacity. The FLAC file has the wrong duration, it is too short. The mp3 file is the correct duration. I would like to know how to fix this or if it is a bug.
I should explain and clarify my problem. I used Audacity to create a two-track project with a tone in each channel for audio testing purposes. In the first channel it is 2 seconds long followed by a 2 second silence. In the second channel it is the same, but the 2 second silence precedes the tone. The intent is to test a stereo output (one channel being assigned left, the other right).
I use both DJay and Serato DJ. However Serato supports FLAC format which most of my library consists of. FLACs offer a higher quality audio output, and I have to convert them to MP3 if i want to play them with DJay. When will DJay support other audio formats, i.e., FLAC?
c) not all media server programs can send all sort of files through your network so that the recipient, the renderer, can understand what the files is. In your case the original Synology DSM can show you DSD files by accessing the drive with a computer, but it cannot serve DSD files with the pre-installed audio server by Synology, nor can it handle DSd files with the DSaudio tablet/smartphone app.
If you lurk around enough audiophile-related sites, you may stumble upon writers claiming a difference in sound between the same music played back in FLAC or WAV format. This article on The Well-Tempered Computer does a nice job of exploring this concept, both from the perspective of those who don't believe such a thing is possible and from those who think there is a difference.
The Well-Tempered Computer article suggests loading both files into an audio editor and subtracting the two tracks. I thought about this for a while; I could load Audacity, mess around to get the starting points aligned, subtract the two, and voilà, the bitstream of zeros would show that the files are equivalent. But I foresaw a fair bit of work in that approach, plus I didn't see how to best present the bitstream of zeros as evidence. So, having Linux on hand, I started a terminal session and proceeded as follows.
First, I used the command-line flac utility to convert a first-generation 24-bit, 44.1kHz WAV file to FLAC, then created a test directory where I could save the FLAC and the subsequent second-generation WAV file.
df19127ead