Difference between revisions of "Free Lossless Audio Codec"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(Externals links: "File Size vs. Decoding Speed" link (dead/broken).)
(Cons: FLAC only supports up to 32-bit integer, and no floating-point support unlike WavPack)
 
(87 intermediate revisions by 52 users not shown)
Line 4: Line 4:
 
| type = lossless
 
| type = lossless
 
| purpose = Popular open source patent free lossless compression scheme.
 
| purpose = Popular open source patent free lossless compression scheme.
| maintainer = Josh Coalson, Xiph Community  
+
| maintainer = Josh Coalson, Xiph Community
 +
| released = {{start date and age|2001}}
 
| recommended_encoder = FLAC encoder
 
| recommended_encoder = FLAC encoder
| recommended_text = FLAC v1.2.1
+
| recommended_text = FLAC v1.4.3 (23 Jun 2023)
| website = http://flac.sourceforge.net/
+
| website = http://xiph.org/flac/
 
}}
 
}}
'''Free Lossless Audio Codec''' ('''FLAC''') is a codec for lossless audiocompression.
+
'''Free Lossless Audio Codec''' ('''FLAC''') is a codec for lossless audio compression.
Grossly oversimplified, FLAC is similar to [[MP3]], but [[lossless]], meaning that audio is compressed in FLAC without any loss in quality. This is similar to how Zip works, except with FLAC you will get much better compression because it is designed specifically for audio, and you can play back compressed FLAC files in your favorite player (or your car or home stereo, if supported) just like you would an MP3 file.
+
Grossly oversimplified, FLAC is similar to [[MP3]], but [[lossless]], meaning that audio is compressed in FLAC without any loss in quality. This is similar to how Zip works, except with FLAC you will get much better compression because it is designed specifically for audio, and you can play back compressed FLAC files in your favorite player (or your car or home stereo, if supported) just like you would a lossy file.
 +
 
 +
FLAC is natively supported in Android since version 3.1, in Windows 10, and in macOS High Sierra 10.13.
  
 
== General aspects of the format ==
 
== General aspects of the format ==
Line 22: Line 25:
 
* input plugins for various music players
 
* input plugins for various music players
  
When it's said that FLAC is ''free'', it means more than just that it is available at no cost. It means that the specification of the format is fully open to the public to be used for any purpose, although the FLAC project reserves the right to set the FLAC specification and certify compliance. It also means that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any known patent. And it means that all the source code is available under open-source licenses. It is the first truly open and free lossless audio format.
+
When it's said that FLAC is ''free'', it means more than just that it is available at no cost. It means that the specification of the format is fully open to the public to be used for any purpose, although the FLAC project reserves the right to set the FLAC specification and certify compliance. It also means that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any known patent. And it means that all the source code is available under [http://xiph.org/flac/license.html open-source licenses]. It is the first truly open and free lossless audio format.
 
+
Some claim FLAC is the most widely used lossless compression format on UNIX systems, though it seems more likely that shn retains that honor on all OS platforms. FLAC files also can be placed inside an Ogg container using libOggFLAC and libOggFLAC++.
+
  
 
== Features ==
 
== Features ==
 
* '''Lossless:''' The encoding of audio (PCM) data incurs no loss of information, and the decoded audio is bit-for-bit identical to what went into the encoder. Each frame contains a 16-bit CRC of the frame data for detecting transmission errors. The integrity of the audio data is further insured by storing an MD5 signature of the original unencoded audio data in the file header, which can be compared against later during decoding or testing.
 
* '''Lossless:''' The encoding of audio (PCM) data incurs no loss of information, and the decoded audio is bit-for-bit identical to what went into the encoder. Each frame contains a 16-bit CRC of the frame data for detecting transmission errors. The integrity of the audio data is further insured by storing an MD5 signature of the original unencoded audio data in the file header, which can be compared against later during decoding or testing.
 
* '''Fast:''' FLAC is asymmetric in favor of decode speed. Decoding requires only integer arithmetic, and is much less compute-intensive than for most perceptual codecs. Real-time decode performance is easily achievable on even modest hardware.
 
* '''Fast:''' FLAC is asymmetric in favor of decode speed. Decoding requires only integer arithmetic, and is much less compute-intensive than for most perceptual codecs. Real-time decode performance is easily achievable on even modest hardware.
* '''Hardware support:''' Because of FLAC's free reference implementation and low decoding complexity, FLAC is currently the only lossless codec that has any kind of hardware support.
+
* '''Hardware support:''' Because of FLAC's free reference implementation, low decoding complexity and popularity, FLAC has relatively widespread hardware support compared to other lossless formats.
 
* '''Streamable:''' Each FLAC frame contains enough data to decode that frame. FLAC does not even rely on previous or following frames. FLAC uses sync codes and CRCs (similar to MPEG and other formats), which, along with framing, allow decoders to pick up in the middle of a stream with a minimum of delay.
 
* '''Streamable:''' Each FLAC frame contains enough data to decode that frame. FLAC does not even rely on previous or following frames. FLAC uses sync codes and CRCs (similar to MPEG and other formats), which, along with framing, allow decoders to pick up in the middle of a stream with a minimum of delay.
 
* '''Seekable:''' FLAC supports fast sample-accurate seeking. Not only is this useful for playback, it makes FLAC files suitable for use in editing applications.
 
* '''Seekable:''' FLAC supports fast sample-accurate seeking. Not only is this useful for playback, it makes FLAC files suitable for use in editing applications.
 
* '''Flexible metadata:''' New metadata blocks can be defined and implemented in future versions of FLAC without breaking older streams or decoders. Currently there are metadata types for tags, cue sheets, and seek tables. Applications can write their own APPLICATION metadata once they register an ID.
 
* '''Flexible metadata:''' New metadata blocks can be defined and implemented in future versions of FLAC without breaking older streams or decoders. Currently there are metadata types for tags, cue sheets, and seek tables. Applications can write their own APPLICATION metadata once they register an ID.
* '''Suitable for archiving:''' FLAC is an open format, and there is no generation loss if you need to convert your data to another format in the future. In addition to the frame CRCs and MD5 signature, flac has a verify option that decodes the encoded stream in parallel with the encoding process and compares the result to the original, aborting with an error if there is a mismatch.
+
* '''Suitable for archiving:''' FLAC is an open format, and there is no generation loss if you need to convert your data to another format in the future. In addition to the frame CRCs and MD5 signature, FLAC has a verify option that decodes the encoded stream in parallel with the encoding process and compares the result to the original, aborting with an error if there is a mismatch.
 
* '''Convenient CD archiving:''' FLAC has a ''cue sheet'' metadata block for storing a CD table of contents and all track and index points. For instance, you can rip a CD to a single file, then import the CD's extracted cue sheet while encoding to yield a single file representation of the entire CD. If your original CD is damaged, the cue sheet can be exported later in order to burn an exact copy.
 
* '''Convenient CD archiving:''' FLAC has a ''cue sheet'' metadata block for storing a CD table of contents and all track and index points. For instance, you can rip a CD to a single file, then import the CD's extracted cue sheet while encoding to yield a single file representation of the entire CD. If your original CD is damaged, the cue sheet can be exported later in order to burn an exact copy.
 
* '''Error resistant:''' Because of FLAC's framing, stream errors limit the damage to the frame in which the error occurred, typically a small fraction of a second worth of data. Contrast this with some other lossless codecs, in which a single error destroys the remainder of the stream.
 
* '''Error resistant:''' Because of FLAC's framing, stream errors limit the damage to the frame in which the error occurred, typically a small fraction of a second worth of data. Contrast this with some other lossless codecs, in which a single error destroys the remainder of the stream.
Line 39: Line 40:
 
== Pros ==
 
== Pros ==
 
* Portable to many systems
 
* Portable to many systems
* Source open and freely licenced
+
* Open source and freely licensed
 
* Hardware support (PhatBox, Kenwood MusicKeg, Rio Karma, etc.  See below)
 
* Hardware support (PhatBox, Kenwood MusicKeg, Rio Karma, etc.  See below)
 
* Streaming support
 
* Streaming support
Line 51: Line 52:
 
* Compresses less efficiently than other popular modern compressors ([[Monkey's Audio]], [[OptimFROG]])
 
* Compresses less efficiently than other popular modern compressors ([[Monkey's Audio]], [[OptimFROG]])
 
* Higher compression modes slow, for little gain over the default setting.
 
* Higher compression modes slow, for little gain over the default setting.
 +
* Only integer bit depth (up to 32-bit int) format are supported, or in other words, no floating-point support.
  
 
== Hardware and software that support FLAC ==
 
== Hardware and software that support FLAC ==
For a more comprehensive list see the [http://flac.sourceforge.net/links.html FLAC links page].
+
For a more comprehensive list see the [http://xiph.org/flac/links.html FLAC links page].
  
 
=== Hardware ===
 
=== Hardware ===
 +
==== Car stereo ====
 +
* Kenwood [http://www.kenwood.com/cs/ce/audiofile/index.php?model=KMM KMM series]
 +
* Pioneer [http://www.pioneer.eu/eur/products/25/121/61/overview.html Car Stereo] (search FLAC)
 +
* JVC [http://mobile.jvc.com/product.jsp?pathId=139 KD-X "Digital Media Receivers" series] (almost all)
 +
* Soundstream [http://soundstream.com/store/car-video/source-units.html Source Units]
 +
* Tesla Model S
 +
* Citroën DS5
 +
* Volvo Sensus (SPA Platform)
 +
 
==== Home stereo ====
 
==== Home stereo ====
* [http://www.request.com/us/ AudioReQuest] music servers
 
* <s>[http://www.avegasystems.com/ Avega Systems]</s>' wireless <s>[http://www.avegasystems.com/_documents/Oyster_Specifications.pdf Oyster]</s> loudspeakers
 
* Digital Techniques' "iStereo" <s>[http://www.digitaltechniques.com/M300A_Overview.html M300A Digital Music Player]
 
* Escient's <s>[http://www.escient.com/ FireBall servers (E2-40/160/300, DVDM-300)]</s>
 
* <s>[http://www.hermstedt.com/english/hifidelio/hifidelio.html Hifidelio]</s>
 
* <s>[http://www.imuse.us/ iMuse]</s> audio/video media servers
 
* Meda Systems' <s>[http://www.medainc.com/ Bravo servers]</s>
 
* The <s>[http://www.cesweb.org/attendees/show_floor/product_locator/product_details.asp?prodid=5181 MS300 Music Server]</s> by McIntosh Laboratory
 
 
* Olive's [http://www.olive.us/ Symphony] wireless digital music center
 
* Olive's [http://www.olive.us/ Symphony] wireless digital music center
* <s>[http://www.phatnoise.com/products/homeplayer/index.php PhatNoise Home Digital Media Player]</s>
 
 
* [http://www.numark.com/ Numark]'s DJ equipment (HDX and CDX turntables, HDMIX mixer)
 
* [http://www.numark.com/ Numark]'s DJ equipment (HDX and CDX turntables, HDMIX mixer)
* <s>[http://www.mock.com/receiver/ Rio Reciever]</s> and Dell Digital Audio Receiver
 
* <s>[http://www.rokulabs.com/products/photobridge/features.php Roku PhotoBridge HD]</s> (with [http://homepage.ntlworld.ie/p.mc.quillan/FLAC_V0.7.zip plugin])
 
* <s>[http://www.skipjam.com/ SkipJam]</s>'s networked audio/video devices
 
 
* [http://www.sonos.com/ Sonos Digital Music System]
 
* [http://www.sonos.com/ Sonos Digital Music System]
* Slim Devices' <s>[http://www.slimdevices.com/pi_transporter.html Transporter]</s> and [http://www.slimdevices.com/pi_squeezebox.html Squeezebox] networked audio players
+
* Slim Devices' [http://www.slimdevices.com/pi_squeezebox.html Squeezebox] networked audio players
* <s>[http://www.z500series.com/ Zensonic Z500 Networked DVD Media Player]</s>
+
* Ziova's <s>[http://www.ziova.com/cs510.php CS510]</s> and <s>[http://www.ziova.com/cs505.php CS505]</s> network media players
+
 
+
==== Car stereo ====
+
* <s>[http://www.phatnoise.com/products/digitalmediaplayers/kenwood_music_keg.php Kenwood Music Keg]</s>
+
* <s>[http://www.phatnoise.com/products/digitalmediaplayers/index.php PhatBox]</s>
+
  
 
==== Portable ====
 
==== Portable ====
 
* [[Apple iPod]] with [[Rockbox]] firmware
 
* [[Apple iPod]] with [[Rockbox]] firmware
* Bluedot's <s>[http://www.digitalworldtokyo.com/2006/07/bluedot_pmp_runs_linux_loves.php BMP-1430]</s>
 
* Green Apple's portable media player: <s>[http://www.apod.com.cn/show_products.asp?photoID=437 AP3000]</s>
 
 
* [[iAudio M3]], M5 and X5
 
* [[iAudio M3]], M5 and X5
 
* [[iRiver]] iHP-120/iHP-140 with [[Rockbox]] firmware
 
* [[iRiver]] iHP-120/iHP-140 with [[Rockbox]] firmware
 
* [[Iwod G10]]
 
* [[Iwod G10]]
 
* [[Rio Karma]]
 
* [[Rio Karma]]
 +
* [http://en.wikipedia.org/wiki/SanDisk_Sansa SanDisk Sansa]
 
* TrekStor's [http://www.trekstor.de/en/products/detail_mp3.php?pid=66 Vibez]
 
* TrekStor's [http://www.trekstor.de/en/products/detail_mp3.php?pid=66 Vibez]
 +
* Devices running Android 3.1+
 +
* [[Pono|Pono Player]]
 +
* [http://en.wikipedia.org/wiki/FiiO_X_Series FiiO X Series]
  
=== Software ===
+
== Software ==
==== Players ====
+
* [http://koti.welho.com/hylinen/apollo/ Apollo]
+
* [http://cogosx.sourceforge.net Cog] — for Mac OS X
+
* [[foobar2000]]
+
* [[JRiver Media Center]]
+
* [http://fondriest.frederic.free.fr/realisations/lamip/ LAMIP]
+
* [[MediaMonkey]]
+
* [http://www.mplayerhq.hu/ MPlayer]
+
* [http://www.mythtv.org/ MythTV]
+
* [http://www.quinnware.com/ QCD] ([http://www.quinnware.com/list_plugins.php?type=input plugin])
+
* [http://www.videolan.org/ VLC]
+
* [http://www.vuplayer.com/vuplayer.htm VUPlayer]
+
* [[Winamp]]
+
* [[Windows Media Player]] and other directshow-based players (MPC, TCMP, RadLight) (with <s>[http://www.illiminable.com/ogg/ Illiminable's directshow filters]</s> or <s>[http://corecodec.org/projects/coreflac CoreFLAC]</s>)
+
* [http://xine.sourceforge.net/ Xine]
+
* [[XMMS]]
+
* [http://www.un4seen.com/ XMplay]
+
  
==== Frontends (Windows) ====
+
==== Players Software ====
* <s>[http://www.uninformative.com/flacattack/ Flacattack]</s>
+
* Custom [http://members.home.nl/w.speek/flac.htm Windows Frontend] (by Speek)
+
*Windows
* <s>[http://www.unifront.boereck.de/ UniversalFront]</s> by Böreck
+
*# [[foobar2000]]
* [http://home.vxu.se/mdati00/frontah/ Frontah] by Madah
+
*# [[MediaMonkey]]
* <s>[http://www.webearce.com.ar/ MAREO]</s> by Kwanbis
+
*# [[MusicBee]]
 +
*# [[Winamp]]
 +
*# [https://www.aimp.ru/ AIMP]
 +
*# [[VLC]]
 +
*# [http://www.un4seen.com/ XMPlay]
 +
*# [http://mplayerwin.sourceforge.net/ MPlayer] Console player
  
==== Frontends (Mac) ====
+
*Mac
* <s>[http://www.danrules.com/macflac/ MacFLAC]</s>
+
*# [[foobar2000]]
* [http://www.sbooth.org/Max/ Max]
+
*# [http://cogx.org/ Cog]
* <s>[http://members.rogers.com/beamsplitter/ RipBeak]</s>
+
*# [[VLC]]
* <s>[http://www.versiontracker.com/dyn/moreinfo/macosx/21952 xACT]</s>
+
*# [http://coppertino.com/ VOX]
  
==== Converters ====
+
*Linux
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / CD Writer
+
*# [http://www.clementine-player.org/ Clementine]
* [http://www.mediamonkey.com/ MediaMonkey] Music Manager / Audio Player / CD Writer
+
*# [http://www.mplayerhq.hu/ MPlayer]
* <s>[http://www.germanixsoft.de/ GX:Transcoder]</s> Music converter
+
*# [http://www.mythtv.org/ MythTV]
 +
*# [[VLC]]
 +
*# [[XMMS]]
 +
 
 +
*Android
 +
*# [https://powerampapp.com/ Poweramp]
 +
*# [https://www.aimp.ru/ AIMP]
 +
*# [[foobar2000]]
 +
*# [[VLC]]
 +
 
 +
===Frontends (Windows)===
 +
* [[foobar2000]] Music Converter / Audio Player
 +
* [https://moisescardona.me/flac-gui/ FLAC GUI] (By Moisés Cardona)
 +
* <s> FLAC frontend (ktf) </s>
 +
* <s> Windows Frontend (by Speek) </s>
 +
 
 +
===Frontends (Mac)===
 +
* [http://www.sbooth.org/Max/ Max]
 +
 +
===Converters===
 +
*for a more comprehensive list [http://wiki.hydrogenaud.io/index.php?title=Download_page#Transcoders here]
 +
*# [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / CD Writer
 +
*# [[ MediaMonkey]] Music Manager / Audio Player / CD Writer
 +
*# [[fre:ac]] Music Converter / CD Writer/Ripper
 +
*# [[foobar2000]] Music Converter / Audio Player
  
==== Editors ====
+
===Editors===
* [[Adobe Audition]]
+
*List of popular audio editors
* [http://www.goldwave.com/ GoldWave]
+
*# [[Audacity]]
 +
*# [[Adobe Audition]]
 +
*# [http://www.goldwave.com/ GoldWave]
  
==== CD writers/rippers ====
+
===CD writers/rippers===
* [http://www.ahead.de Ahead Nero Burning Rom]
+
*for a comprehensive list of CD/DVD [http://wiki.hydrogenaud.io/index.php?title=Download_page#CD.2FDVD_Writers Writers] & [http://wiki.hydrogenaud.io/index.php?title=Download_page#CD_Rippers rippers]
* [http://arson.sourceforge.net/ Arson]
+
*# [http://www.nero.com/eng/ Nero]
* [http://www.burnatonce.com/ burnatonce]
+
*# [http://cdburnerxp.se/ CDBurnerXP] CD writer
* [http://www.burrrn.net Burrrn] Audio CD burner
+
*# [[MediaMonkey]] - CD ripper/writer
* [[Exact Audio Copy]] CD Ripper
+
*# [[Exact Audio Copy]] CD Ripper
* [http://cdexos.sourceforge.net CDex] CD ripper
+
*# [http://www.cdwave.com/ CD Wave]
* [http://www.cdwave.com/ CD Wave]
+
*# [http://arson.sourceforge.net/ Arson]
* [http://www.mediamonkey.com/ MediaMonkey] - [[MediaMonkey]] CD ripper/writer
+
*# <!--[http://www.burrrn.net--> Burrrn <!--]--> Audio CD burner
* [http://cdburnerxp.se/ CDburner XP] CD writer
+
*# <!--[http://cdexos.sourceforge.net--> CDex<!--]--> CD ripper
  
==== Taggers ====
+
===Taggers===
* <s>[http://www.saunalahti.fi/cse/files/Tag.zip Case's Tag]</s> command line tagger
+
*for a comprehensive list of tag editors [[http://wiki.hydrogenaud.io/index.php?title=Download_page#Tagging_Utilities here]]
* [http://www.jtclipper.eu/thegodfather/ The GodFather] Tagger / Music manager
+
*# [[Mp3tag]] - Universal Tag Editor
* [http://www.mp3tag.de/en/index.html Mp3tag] Universal Tag Editor
+
*# [http://www.xdlab.ru/en/ TagScanner] - "The Ultimate Tag Editor"
* [http://sbooth.org/Tag/ Tag] for Mac OS X 10.4 (Tiger)
+
*# [[foobar2000]]
* [http://flac.sourceforge.net/documentation.html#metaflac metaflac] - for general metadata (including Vorbis comments) maintenance
+
*# [[MediaMonkey]] - Tagger / Music manager (Including multiple and linked album art support)
* [http://www.mediamonkey.com MediaMonkey] - [[MediaMonkey]] Tagger / Music manager (Including Multiple and Linked Album Art support)
+
*# [http://www.jtclipper.eu/thegodfather/ The GodFather] - Tagger / Music manager
 +
*# [http://sbooth.org/Tag/ Tag] - for Mac OS X 10.4 (Tiger)
 +
*# <s>[http://www.synthetic-soul.co.uk/tag/ Case's Tag] - Command line tagger </s>
 +
*# [https://xiph.org/flac/documentation_tools_metaflac.html metaflac] - for general metadata (including Vorbis comments) maintenance
  
 
==== Other tools ====
 
==== Other tools ====
* <s>[http://www.burrrn.net/mrq/ Mr. QuestionMan]</s>
 
* <s>[http://www.bitattack.ro/ai/ Audio Identifier]</s>
 
 
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] - tool to multiplex FLAC streams inside the Matroska container
 
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] - tool to multiplex FLAC streams inside the Matroska container
* [http://flac.sourceforge.net/documentation.html#metaflac metaflac] - for general metadata (including Vorbis comments) maintenance, also to calculate [[ReplayGain]] values for FLAC files lacking such
+
* [https://xiph.org/flac/documentation_tools_metaflac.html metaflac] - for general metadata (including Vorbis comments) maintenance, also to calculate [[ReplayGain]] values for FLAC files lacking such
 
+
...and many more; see the [http://flac.sourceforge.net/links.html#software FLAC software section] and [http://flac.sourceforge.net/download.html#extras download section] for a more comprehensive list.
+
  
 
== Frequently asked questions ==
 
== Frequently asked questions ==
Line 175: Line 183:
 
* [[Lossless]]
 
* [[Lossless]]
 
* [[Lossless comparison]]
 
* [[Lossless comparison]]
 +
* [[FLAC decoder testbench]]
  
== Externals links ==
+
== External links ==
* [http://flac.sourceforge.net/ FLAC website]
+
* [http://xiph.org/flac/ FLAC homepage]
* [http://flac.sourceforge.net/download.html FLAC download]
+
* {{ha|http://hydrogenaud.io/index.php/board,67.0.html|FLAC discussion board}}
* [http://flac.sourceforge.net/format.html Detailed description of the FLAC format]
+
* {{ha|https://hydrogenaud.io/index.php/topic,123025.0.html|FLAC v1.4.x Performance Tests}}
* [http://flac.sourceforge.net/documentation.html FLAC documentation]
+
* {{ha|https://hydrogenaud.io/index.php/topic,124356.0.html|FLAC 1.4.3 topic}}
* [http://flac.sourceforge.net/faq.html FLAC FAQ]
+
* {{ha|https://hydrogenaud.io/index.php/topic,123234.0.html|FLAC 1.4.2 topic}}
* <s>[http://people.ucsc.edu/~rswilson/flactest Omion's FLAC "File Size vs. Decoding Speed" test]</s> - a very thorough test on [[Free Lossless Audio Codec#Frequently Asked Questions|the influence of the chosen encoding level on the decoding speed of FLAC]]; the only one so far to have covered FLAC's --super-secret-totally-impractical-compression-level to this extent as well.
+
* {{ha|https://hydrogenaud.io/index.php/topic,122949.0.html|FLAC 1.4.0 topic}}
 
+
* {{ha|https://hydrogenaud.io/index.php/topic,118008.msg974100/topicseen.html#new|FLAC 1.3.3 topic}}
 +
* {{ha|http://hydrogenaud.io/index.php/topic,107611.0.html|FLAC 1.3.1 topic}}
 +
* {{ha|http://hydrogenaud.io/index.php/topic,107913.0.html|FLAC 1.3.1 non-SSE2 build for older CPUs}}
 +
* {{ha|http://hydrogenaud.io/index.php/topic,107990.0.html|Lossless codec comparison (Jan ’15)}} by [http://hydrogenaud.io/index.php?action=profile;u=68263 ktf] graphs the influence of the chosen encoding level on the encoding and decoding performance of FLAC 1.3.1 and various other lossless codecs. Omion's older test, "[http://web.archive.org/web/20091108104748/http://people.ucsc.edu/~rswilson/flactest File Size vs. Decoding Speed]", covers the influence of the chosen encoding level on the decoding speed of FLAC 1.2.1.
  
 +
[[Category:Codecs]]
 
[[Category:Lossless]]
 
[[Category:Lossless]]
 
[[Category:Encoder/Decoder]]
 
[[Category:Encoder/Decoder]]

Latest revision as of 00:32, 20 October 2023

Free Lossless Audio Codec (FLAC) is a codec for lossless audio compression. Grossly oversimplified, FLAC is similar to MP3, but lossless, meaning that audio is compressed in FLAC without any loss in quality. This is similar to how Zip works, except with FLAC you will get much better compression because it is designed specifically for audio, and you can play back compressed FLAC files in your favorite player (or your car or home stereo, if supported) just like you would a lossy file.

FLAC is natively supported in Android since version 3.1, in Windows 10, and in macOS High Sierra 10.13.

General aspects of the format

FLAC is freely available and supported on most operating systems, including Windows, UNIX (Linux, *BSD, Solaris, OS X, IRIX), BeOS, OS/2, and Amiga. There are build systems for autotools, MSVC, Watcom C, and Project Builder.

The FLAC project consists of:

  • the stream format
  • reference encoders and decoders in library form
  • flac, a command-line program to encode and decode FLAC files
  • metaflac, a command-line metadata editor for FLAC files
  • input plugins for various music players

When it's said that FLAC is free, it means more than just that it is available at no cost. It means that the specification of the format is fully open to the public to be used for any purpose, although the FLAC project reserves the right to set the FLAC specification and certify compliance. It also means that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any known patent. And it means that all the source code is available under open-source licenses. It is the first truly open and free lossless audio format.

Features

  • Lossless: The encoding of audio (PCM) data incurs no loss of information, and the decoded audio is bit-for-bit identical to what went into the encoder. Each frame contains a 16-bit CRC of the frame data for detecting transmission errors. The integrity of the audio data is further insured by storing an MD5 signature of the original unencoded audio data in the file header, which can be compared against later during decoding or testing.
  • Fast: FLAC is asymmetric in favor of decode speed. Decoding requires only integer arithmetic, and is much less compute-intensive than for most perceptual codecs. Real-time decode performance is easily achievable on even modest hardware.
  • Hardware support: Because of FLAC's free reference implementation, low decoding complexity and popularity, FLAC has relatively widespread hardware support compared to other lossless formats.
  • Streamable: Each FLAC frame contains enough data to decode that frame. FLAC does not even rely on previous or following frames. FLAC uses sync codes and CRCs (similar to MPEG and other formats), which, along with framing, allow decoders to pick up in the middle of a stream with a minimum of delay.
  • Seekable: FLAC supports fast sample-accurate seeking. Not only is this useful for playback, it makes FLAC files suitable for use in editing applications.
  • Flexible metadata: New metadata blocks can be defined and implemented in future versions of FLAC without breaking older streams or decoders. Currently there are metadata types for tags, cue sheets, and seek tables. Applications can write their own APPLICATION metadata once they register an ID.
  • Suitable for archiving: FLAC is an open format, and there is no generation loss if you need to convert your data to another format in the future. In addition to the frame CRCs and MD5 signature, FLAC has a verify option that decodes the encoded stream in parallel with the encoding process and compares the result to the original, aborting with an error if there is a mismatch.
  • Convenient CD archiving: FLAC has a cue sheet metadata block for storing a CD table of contents and all track and index points. For instance, you can rip a CD to a single file, then import the CD's extracted cue sheet while encoding to yield a single file representation of the entire CD. If your original CD is damaged, the cue sheet can be exported later in order to burn an exact copy.
  • Error resistant: Because of FLAC's framing, stream errors limit the damage to the frame in which the error occurred, typically a small fraction of a second worth of data. Contrast this with some other lossless codecs, in which a single error destroys the remainder of the stream.

Pros

  • Portable to many systems
  • Open source and freely licensed
  • Hardware support (PhatBox, Kenwood MusicKeg, Rio Karma, etc. See below)
  • Streaming support
  • Extremely fast decoding
  • Supports multichannel and high resolution streams
  • Supports ReplayGain
  • Supports cue-sheet (with some limitations)
  • Gaining wide use as successor to Shorten

Cons

  • Compresses less efficiently than other popular modern compressors (Monkey's Audio, OptimFROG)
  • Higher compression modes slow, for little gain over the default setting.
  • Only integer bit depth (up to 32-bit int) format are supported, or in other words, no floating-point support.

Hardware and software that support FLAC

For a more comprehensive list see the FLAC links page.

Hardware

Car stereo

Home stereo

Portable

Software

Players Software

Frontends (Windows)

  • foobar2000 Music Converter / Audio Player
  • FLAC GUI (By Moisés Cardona)
  • FLAC frontend (ktf)
  • Windows Frontend (by Speek)

Frontends (Mac)

Converters

  • for a more comprehensive list here
    1. dBpowerAMP Music Converter / Audio Player / CD Writer
    2. MediaMonkey Music Manager / Audio Player / CD Writer
    3. fre:ac Music Converter / CD Writer/Ripper
    4. foobar2000 Music Converter / Audio Player

Editors

CD writers/rippers

Taggers

  • for a comprehensive list of tag editors [here]
    1. Mp3tag - Universal Tag Editor
    2. TagScanner - "The Ultimate Tag Editor"
    3. foobar2000
    4. MediaMonkey - Tagger / Music manager (Including multiple and linked album art support)
    5. The GodFather - Tagger / Music manager
    6. Tag - for Mac OS X 10.4 (Tiger)
    7. Case's Tag - Command line tagger
    8. metaflac - for general metadata (including Vorbis comments) maintenance

Other tools

  • mkvtoolnix - tool to multiplex FLAC streams inside the Matroska container
  • metaflac - for general metadata (including Vorbis comments) maintenance, also to calculate ReplayGain values for FLAC files lacking such

Frequently asked questions

Question: Does the compression level affect decompression speed?

Short Answer: No.

Long Answer: In truth, the compression level does affect the decompression speed, but the difference between the various compress levels can barely be measured and is too small to be noticed, even on low-end machines.


Question: What is the best compression level for encoding my music?

Short Answer: The default setting, 5.

Long Answer: Encoding at the default setting will give the best balance between compression and encoding speed. Encoding at 8 can more than quadruple the encoding time, while having an insignificant effect on compression.

See also

External links