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.Even though the reference encoder uses a single block size for the whole stream, FLAC allows the block size in samples to vary per block. Compression
The amount of compression is determined by various parameters, including the order of the linear prediction model and the block size. Regardless of the amount of compression, the original data can always be reconstructed perfectly. For users convenience, the reference implementation defines 9 compression levels, which are presets of the more technical parameters to the encoding algorithm. The levels are labeled from 0 to 8, with higher numbers resulting in a higher compression ratio, at the cost of compression speed. The meaning of each compression level varies by implementation.FLAC is optimized for decoding speed at the expense of encoding speed. A benchmark has shown that, while there is little variation in decoding speed as compression level increases, beyond the default compression level 5, the encoding process takes up considerably more time with little space saved compared to level 5. Comparison to other formats
FLAC is specifically designed for efficient packing of audio data, unlike general-purpose lossless algorithms such as DEFLATE, which are used in ZIP and gzip.
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 or uncompressed PCM. FLAC support is included by default in Windows 10, Android, BlackBerry 10 and Jolla devices. In 2014, several aftermarket mobile electronics companies introduced multimedia solutions that include support for FLAC. These include the NEX series from Pioneer Electronics and the VX404 and NX404 from Clarion. The European Broadcasting Union (EBU) has adopted the FLAC format for the distribution of high quality audio over its Euroradio network. The Windows operating system has supported native FLAC integration since the introduction of Windows 10. The Android operating system has supported native FLAC playback since version 3.1. macOS High Sierra and iOS 11 add native FLAC playback support.Among others the Pono music player and streaming service used the FLAC format. Bandcamp insists on a lossless format for uploading, and has FLAC as a download option. The Wikimedia Foundation sponsored a free and open-source online ECMAScript FLAC tool for browsers supporting the required HTML5 features.