https://wiki.hydrogenaud.io/api.php?action=feedcontributions&user=Mjb&feedformat=atomHydrogenaudio Knowledgebase - User contributions [en]2024-03-29T08:02:52ZUser contributionsMediaWiki 1.22.7https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Titleformat_ExamplesFoobar2000:Titleformat Examples2022-11-21T01:40:19Z<p>Mjb: /* Peak to Loudness Ratio (PLR) */ I changed the code so it would match the explanation</p>
<hr />
<div>{{sidebar foobar2000 title formatting}}<br />
These are some examples of general title format usage contributed by users. They may be of utility to others using Masstagger or other components. Feel free to sign up and contribute your own examples!<br />
<br />
Please make sure that you rejoin scripts that have been split into multiple lines before pasting them into the masstagger window. The reason that they are split is to keep this page's formatting readable in your browser.<br />
<br />
==Shorter examples==<br />
<br />
===Return corresponding tag field===<br />
%tag%<br />
* Example: If artist field is ''blah'', %artist% will return ''blah''.<br />
* Note: You can insert any character (or space) in between two tags, in front or after; so, if %artist% is ''blah'' and %title% is ''bleh'': ''%artist%X%title%'' returns ''blahXbleh''.<br />
<br />
===Trunctuate %tag% to a length of X characters===<br />
$cut(%tag%,X)<br />
* Example: If artist field is ''blah'', $cut(%artist%,3) returns ''bla''<br />
<br />
===Truncate %tag% by X characters, and add ... at the end of the cut===<br />
$cut(%tag%,X)...<br />
* Example: If artist field is ''blah'', ''$cut(%artist%,3)...'' returns ''bla...''<br />
<br />
===Return numerical value of %tag%, and pad with 0s to X characters===<br />
$num(%tag%,X)<br />
* Example: If %tracknumber% field is ''3'', ''$num(%tracknumber%,2)'' will return ''03''. If ''13'', it will return ''13''.<br />
<br />
===Return first two characters of a filename, and display as number (if present) padded with 0s to X characters===<br />
$num($left(%_filename%),2)<br />
* Example: A filename of ''03_artist_title.mpc'' will return ''03''.<br />
<br />
===Find first occurrence of character X in %tag%, and return everything in front of X===<br />
$puts(spacer,$strchr(%tag%,X))<br />
$trim($left(%tag%,$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
<br />
==Longer examples==<br />
<br />
In the next few strings, I have decided to make it possible to define the %tag% that should be edited and the character or string that is used to determine where to trunctuate; these can be defined as variables in the beginning of the string as $puts(tag,%tag%), $puts(char,X), etc. Basically the reason I have done this is to make it simpler to edit these strings, to what you want them to do at that exact moment, in the rather narrow masstager input field. That way it is possible to enter the needed tags and characters only once in the beginning of the line. Again, simply replace %tag% and X by the desired values. Also all of these strings will trim off the trailing and leading spaces of the output (in case there are any).<br />
<br />
===Find first occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
* Note: this does exactly the same as the last string mentioned above, except for the introdution of the two variables in the front, meant for easy editing (see explanation above).<br />
<br />
===Find last occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' returns ''blah'', and ''blah X bleh X bluh'' returns ''blah X bleh''<br />
<br />
===Find first occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bleh X bluh''<br />
<br />
===Find last occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bluh''<br />
<br />
===Find first occurence of character X and last occurence of character Y, and return everything in-between===<br />
$puts(char1,X)$puts(char2,Y)$puts(tag,%tag%)<br />
$puts(spacer1,$strchr($get(tag),$get(char1)))<br />
$puts(spacer2,$strrchr($get(tag),$get(char2)))<br />
$trim($substr($get(tag),$add($get(spacer1),1),$sub($get(spacer2),1)))<br />
* Example: ''blah X bleh Y bluh'' returns ''bleh''<br />
* Note: In most cases, ''X'' will probably be equal to ''y'' here.<br />
<br />
===Find first occurence of string XYZ, and return everything in front of string XYZ===<br />
$puts(string,XYZ)$puts(tag,%tag%)$puts(spacer,$strstr($get(tag),<br />
$get(string)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah XYZ bleh'' returns ''blah''<br />
* String ''XYZ'' can basically be any combination of characters or words.<br />
* If the string isn't found, everything is returned<br />
<br />
===Find first occurence of string XYZ in %tag% field, and return everything after XYZ:===<br />
$puts(string,XYZ)$puts(tag,%tag%)<br />
$puts(spacer,$strstr($get(tag),$get(string)))<br />
$trim($right($get(tag),$sub($len($get(tag)),<br />
$add($get(spacer),$len($get(string))))))<br />
* Example: ''blah XYZ bleh'' returns ''bleh''<br />
<br />
===Get everything between two strings of your choice===<br />
<!-- Credit: herojoker in hydrogenaudio.org/forums/index.php?showtopic=89453 --><br />
Assuming a text accessible via %someTag% contains the strings ''<coolTag>'' and ''<blaTag>'', in that order, you can get everything between them (e.g. ''xyz'' from ''<coolTag>xyz<blaTag>'') using this code:<br />
$substr(%someTag%,$add($strstr(%someTag%,<coolTag>),$len(<coolTag>)),$sub($strstr(%someTag%,<blaTag>),1))<br />
What does it do, and how?<br />
* ''$substr(%someTag%,X,Y)'' yields everything of %someTag% from the Xth character to the Yth character. In this case we have:<br />
* X = ''$add($strstr(%someTag%,<coolTag>),$len(<coolTag>))'',<br />
: i.e. the position of ''<coolTag>'' in %someTag% plus the length of the word ''<coolTag>''<br />
* Y = ''$sub($strstr(%someTag%,<blaTag>),1)''<br />
: i.e. the position of ''<blaTag>'' in %someTag% minus one; the subtraction is performed because otherwise the code would yield ''<'' (the first character of ''<blaTag>'') as the last character of the output string.<br />
<br />
===Test whether %tag% field contains string XYZ===<br />
$puts(string,XYZ)<br />
$puts(tag,%tag%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string)<br />
<br />
An example of how this could be used:<br />
$puts(string,rock)<br />
$puts(tag,%genre%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,genre includes $get(string),genre does not include $get(string))<br />
<br />
* With a track that has genre set to ''classic rock'', the output would be ''genre includes rock''.<br />
* With a track that has genre set to ''electronic dance'', the output would be ''genre does not include rock''.<br />
<br />
Note that this will also return the false value if the field is missing or empty. The following can provide a third output in that scenario instead:<br />
$puts(string,XYZ)<br />
$puts(tag,[%tag%])<br />
$if($get(tag),$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string),tag is missing or empty)<br />
<br />
===Samplerate display with decimals (i.e. 44.1khz)===<br />
<br />
Foobar2000 doesn't do floating point math. This is a problem if you want to display your sample rate in a decimal format. This mess of statements will fake this for you while adjusting for rates evenly divisible by 1000 and rates over 100khz.<br />
<br />
<pre>$ifgreater($mod(%samplerate%,1000),0,<br />
$insert($div(%samplerate%,100),'.',$sub($len($div(%samplerate%,100)),1)) kHz,<br />
$div(%samplerate%,1000) kHz)</pre><br />
<br />
===Bit Depth display===<br />
<br />
This will display the current bitdepth of your track. If there is no depth reported, it will automatically just return 16.<br />
<br />
<pre>$ifequal([%__bitspersample%],0,16,%__bitspersample%)</pre><br />
<br />
==Custom columns for playlists==<br />
<br />
===ReplayGain tag summary===<br />
<br />
If album and track gain tags are present, it shows album gain followed by "alb", then track gain followed by "trk". If only track gain is present, it shows track gain is followed by "trk only". If neither tag is present, it shows "n/a". Remove the text-dimming angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre>$if($or(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_ALBUM_GAIN%),<br />
$if(%REPLAYGAIN_ALBUM_GAIN%,%REPLAYGAIN_ALBUM_GAIN%' '<'alb'><br />
$if($not(%REPLAYGAIN_TRACK_GAIN%),<' only'>)' ')<br />
$if(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_TRACK_GAIN% <'trk'><br />
$if(%REPLAYGAIN_ALBUM_GAIN%,, <'only'>)),n/a)</pre><br />
<br />
===Artist and title with fallback for untagged files===<br />
<br />
Shows artist, en dash, title in curly quotes, plus an optional note taken from the filename. Artist and title are read from tags if both are available, otherwise from the filename (in which case the artist is 'unknown' and title is the filename, unless the filename has a dash surrounded by spaces, assumed to be in the format ''artist - title''). If the file name ends with a bracketed note, e.g. ''Artist - Title [intro skips badly].mp3'', the note is appended to the output. Additionally, in the title, the text ''-inch'', or the double quote in ''7"'' and ''12"'', is replaced with the Unicode inch character, ''″''.<br />
<br />
Remove the text-dimming and highlighting angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre>$puts(FILENAME,%filename%)<br />
$puts(TMP,$strstr($get(FILENAME), - ))<br />
$ifgreater($get(TMP),0,<br />
$puts(ARTIST,$trim($left($get(FILENAME),$sub($get(TMP),1))))<br />
$puts(TITLE,$trim($right($get(FILENAME),$sub($len($get(FILENAME)),$add($get(TMP),2)))))<br />
$puts(TITLEONLY,$left($get(TITLE),$sub($strstr($get(TITLE),' ['),1)))<br />
$puts(NOTE,$substr($get(TITLE),$add($len($get(TITLEONLY)),2),$strrchr($get(TITLE),']'))),<br />
$puts(ARTIST,unknown)<br />
$puts(TITLE,$get(FILENAME))<br />
$puts(TITLEONLY,$get(TITLE))<br />
)<br />
$puts(BESTARTIST,$if([$meta(artist)],$meta(artist),$get(ARTIST)))<br />
$puts(BESTTITLE,$if3([$meta(title)],$meta(title),[$get(TITLEONLY)],unknown))<br />
$puts(FORMATTEDTITLE,$replace($get(BESTTITLE),-inch,″,12",12″,7",7″))<br />
>$get(BESTARTIST)<<br />
< – “><br />
$get(FORMATTEDTITLE)<”><br />
$if($get(NOTE),<< $get(NOTE)>>)</pre><br />
<br />
===Peak to Loudness Ratio (PLR)===<br />
<br />
If track gain tags are present, the PLR in [[bel|decibel]]s is calculated and displayed as a single figure, rounded up, based on [[wikipedia:LKFS|LUFS]]. This can be used as an alternative to a [[foobar2000:Components/Dynamic Range Meter (foo_dynamic_range)|dynamic range tag]].<br />
<br />
'''Note:''' The {{code|replaygain_track_peak_db}} field is only available in foobar2000 1.4.1 and later.<br />
<br />
<pre>$if($and([%replaygain_track_gain%],[%replaygain_track_peak_db%]),<br />
$puts(tpfs,$replace(%replaygain_track_peak_db%,.,, dB,))<br />
$puts(lufs,$sub(-2300,$sub($replace(%replaygain_track_gain%,.,, dB,),500)))<br />
$puts(plr,$sub($get(tpfs),$get(lufs)))<br />
$puts(plr_round,$ifgreater($right($get(plr),2),49,$add($get(plr),100),$get(plr)))<br />
$left($get(plr_round),$sub($len($get(plr_round)),2))<br />
)</pre><br />
<br />
===75 FPS CD Timecode===<br />
<br />
If you have any reason for displaying the 75fps timecode of your tracks, this will do it for you.<br />
<br />
<pre>$puts(frm,$div(%samplerate%,75))<br />
$puts(rem,$sub(%length_samples%,$mul(%length_seconds_fp%,%samplerate%)))<br />
$left(%length_ex%,$sub($len(%length_ex%),4)):$num($div($get(rem),$get(frm)),2)</pre><br />
<br />
==Playlist grouping schemes==<br />
<br />
===Album artist and album title, with fallbacks ===<br />
<br />
With this grouping scheme, tracks with album tags are kept separate from streams and other loose tracks. The album artist is taken from %band%, %album artist%, or %artist%, otherwise 'unknown artist'.<br />
<br />
<pre>$if($stricmp($left(%path%,7),'http://'),<Internet streams>,<br />
$if($meta_test(album),<br />
$if($meta_test(band),%band%,<br />
$if($meta_test(album artist),%album artist%,<br />
$if($meta_test(artist),%artist%,unknown artist))) – %album%,<br />
<non-album tracks>))<br />
</pre></div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T17:22:59Z<p>Mjb: /* Resampling */ simplified my previous edits</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values out to three decimal places are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
<!--<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
--><br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Resampling===<br />
<br />
When the input sample rate is greater than 48 kHz, LAME will [[resampling|resample]] it to a maximum of 48 kHz (the maximum supported by MP3). In VBR modes 7 to 9.999, and at CBR bitrates below 104 kbps, the input is resampled to 32000, 24000, 22050, 16000, 12000, 11025, or 8000, depending on the target quality level or bitrate.<br />
<br />
Since it is required when resampling, a filter is always applied to remove frequencies above one-half the sample rate. The lowpass info above is indicating whether any ''additional'' filtering is done.<br />
<br />
LAME's internal resampler is not ideal.<ref>https://hydrogenaud.io/index.php/topic,97479.0.html</ref> If resampling is needed, better results (especially when targeting low bitrates) can be obtained by using a high-quality sample rate converter, such as SoX or SSRC.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T17:20:05Z<p>Mjb: /* Recommended settings details */ The preceding section only recommends to -V6. Instead of -V7 to -V9 it says to use ABR, so I am commenting out the -V7 to V9 info in this table.</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values out to three decimal places are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
<!--<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
--><br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Resampling===<br />
<br />
When the input sample rate is greater than 48 kHz, LAME will [[resampling|resample]] it to a maximum of 48 kHz (the maximum supported by MP3). In VBR mode 7 to 9, resampling is as per the table above. From 9.01 and 9.999, rates of 16000, 12000, 11025, or 8000 are used. CBR mode resampling is similar, using 32000, 24000, 22050, 16000, or 8000 Hz when the bitrate is below 104, 72, 52, 44, or 28 kbps, respectively.<br />
<br />
Since it is required when resampling, a filter is always applied to remove frequencies above one-half the sample rate. The lowpass info above is indicating whether any ''additional'' filtering is done.<br />
<br />
LAME's internal resampler is not ideal.<ref>https://hydrogenaud.io/index.php/topic,97479.0.html</ref> If resampling is needed, better results (especially when targeting low bitrates) can be obtained by using a high-quality sample rate converter, such as SoX or SSRC.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T17:06:39Z<p>Mjb: /* Resampling */ +readers may not understand why the lowpass filter is disabled when resampling; it's because there's already filtering done during resampling</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values out to three decimal places are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Resampling===<br />
<br />
When the input sample rate is greater than 48 kHz, LAME will [[resampling|resample]] it to a maximum of 48 kHz (the maximum supported by MP3). In VBR mode 7 to 9, resampling is as per the table above. From 9.01 and 9.999, rates of 16000, 12000, 11025, or 8000 are used. CBR mode resampling is similar, using 32000, 24000, 22050, 16000, or 8000 Hz when the bitrate is below 104, 72, 52, 44, or 28 kbps, respectively.<br />
<br />
Since it is required when resampling, a filter is always applied to remove frequencies above one-half the sample rate. The lowpass info above is indicating whether any ''additional'' filtering is done.<br />
<br />
LAME's internal resampler is not ideal.<ref>https://hydrogenaud.io/index.php/topic,97479.0.html</ref> If resampling is needed, better results (especially when targeting low bitrates) can be obtained by using a high-quality sample rate converter, such as SoX or SSRC.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T16:44:07Z<p>Mjb: /* VBR (variable bitrate) settings */ three decimal places is the limit on fractional values (e.g. 9.999 is the same as 9.99999999999)</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values out to three decimal places are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Resampling===<br />
<br />
When the input sample rate is greater than 48 kHz, LAME will [[resampling|resample]] it to a maximum of 48 kHz (the maximum supported by MP3). In VBR mode 7 and up, resampling is as per the table above. CBR mode resampling is similar, using 32000, 24000, 22050, 16000, or 8000 Hz when the bitrate is below 104, 72, 52, 44, or 28 kbps, respectively.<br />
<br />
LAME's internal resampler is not ideal.<ref>https://hydrogenaud.io/index.php/topic,97479.0.html</ref> If resampling is needed, better results (especially when targeting low bitrates) can be obtained by using a high-quality sample rate converter, such as SoX or SSRC.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T16:42:50Z<p>Mjb: + Resampling info</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Resampling===<br />
<br />
When the input sample rate is greater than 48 kHz, LAME will [[resampling|resample]] it to a maximum of 48 kHz (the maximum supported by MP3). In VBR mode 7 and up, resampling is as per the table above. CBR mode resampling is similar, using 32000, 24000, 22050, 16000, or 8000 Hz when the bitrate is below 104, 72, 52, 44, or 28 kbps, respectively.<br />
<br />
LAME's internal resampler is not ideal.<ref>https://hydrogenaud.io/index.php/topic,97479.0.html</ref> If resampling is needed, better results (especially when targeting low bitrates) can be obtained by using a high-quality sample rate converter, such as SoX or SSRC.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=ResamplingResampling2016-08-24T16:39:56Z<p>Mjb: /* Resampling or Sample Rate Conversion */ On the forum we get annoyed when people refer to bit depth changes as resampling, so let's discourage such terminology.</p>
<hr />
<div>== Resampling or Sample Rate Conversion ==<br />
Digital audio is always sampled, which means that any digital audio file is created with a fixed sample rate (and resolution). [[Red Book]] [[Compact Disc Digital Audio|Audio CD]]'s sample rate is 44.1kHz (16-bits resolution). Audio on [[DVD]]s is sampled at 96kHz (24-bit resolution). '''Resampling''' or ''Sample Rate Conversion'' is required when one wants to convert a digital audio file (i.e. an analog audio signal that has already been digitized) from a given sample rate into a different sample rate (resolution can stay the same or change). Upsampling (aka interpolation) is the process of converting from a lower to higher sample rate (e.g. from 44.1 kHz to 48 kHz); downsampling (aka decimation) is the process of converting from a higher to a lower sample rate (e.g. from 96 kHz to 48 kHz).<br />
<br />
Changes in bit depth, e.g. from 16-bit to 24-bit, or from 24-bit to 16-bit, may be performed at the same time as resampling, but care should be taken to avoid conflating the two principles. ''Resampling'' or the more specific terms ''upsampling'' or ''downsampling'' usually mean sample rate conversion only.<br />
<br />
Low-quality resampling algorithms, whether upsampling or downsampling, can introduce artifacts which are clearly audible in the resampled audio file. A typical low-quality, but extremely fast resampling algorithm will just be based on linear interpolation. High-quality resampling algorithms use more CPU time, since they require translation to the frequency domain. Modern PC processors (~2 GHz clock) can easily deal with very high-quality resampling in real time. Sound cards that do resampling in real time require a good DSP.<br />
<br />
Resampling is very often required and is in fact part of the audio mastering process for CDs, since professional audio equipment uses 96kHz or 192kHz for masters, whereas the Red Book Audio CD spec uses a 44.1 kHz sample rate. Different media are recorded at different sample rates (CD at 44.1kHz, DAT at 48kHz, DVD audio at 96 kHz, etc). Digitally mixing different sources sampled at different rates will require resampling to a common rate and resolution.<br />
<br />
Many PC audio cards (most notably the 10k1 and 10k2 based Creative Labs ones) and AC97 codecs can only input, output or internally process audio data at 48kHz and forcefully resample any digital audio data at one stage or another. Sometimes the audio software or the drivers will add a resampling step (e.g. ALSA when software mixing, see [http://www.hydrogenaudio.org/forums/index.php?showtopic=47591 this thread]).<br />
<br />
== References ==<br />
* Digital Audio Resampling Home Page: http://ccrma-www.stanford.edu/~jos/resample/<br />
* PeakPro 5 Sample Rate Converter Comparison with Other Audio Applications, Bias Inc., December 2005: X <br />
* Sample Rate Conversion Comparisons (96kHz to 44.1kHz): http://src.infinitewave.ca/<br />
* iZotope 64-bit SRC Precise Sample Rate Conversion: http://www.izotope.com/tech/src/<br />
* Sox Sampling rate conversion. W. G. Unruh 2006: http://axion.physics.ubc.ca/soundcard/resample.html<br />
* An Analysis of Sample Rate Conversion in Sox, Andreas Wilde, 19. Dec. 2003: http://www.leute.server.de/wilde/resample.html<br />
* Lyons, Richard G. Understanding Digital Signal Processing. Indiana: Prentice Hall, March 2004: Edition: 3rd ISBN 0-13-108989-7 <br />
* Secret Rabbit Code (aka libsamplerate): http://www.mega-nerd.com/SRC/index.html<br />
<br />
[[Category:Signal Processing]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2016-08-24T16:12:13Z<p>Mjb: /* Recommended settings details */ lowpass and resample info varies by input sample rate and LAME version. let's just keep track of the current version (3.99.5 at present). updated various values to match current behavior, tested by me</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website], Download site: [http://www.rarewares.org/mp3-lame-bundle.php Rarewares LAME-bundle]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with higher-bitrate settings will have no effect on the perceived quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest. (Note: The "V" has to be a capital letter.)<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* In terms of filesize [[VBR]] tends to produce the smallest files down to -V7. For lower quality (e.g. for non-music audio such as speech) [[ABR]] will produce smaller files than [[VBR]], starting from --abr 115.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 6em; vertical-align: bottom" | [[LAME Y switch|Y Switch]] enabled by default !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter, as of LAME 3.99.5 with 44100 Hz input. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample !! style="width: 6em; vertical-align: bottom" | Formerly Known As<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || 20094 Hz – 20627 Hz || || api<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || style="text-align: center" | none || || ape or apx<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz || || aps<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz || || apm<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 32000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 24000 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | none || style="text-align: right" | 22050 Hz ||<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code> <br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Exact_Audio_CopyExact Audio Copy2016-08-17T08:43:15Z<p>Mjb: 1.2 released recently</p>
<hr />
<div>{{featured}}<br />
{{Software Infobox<br />
| name = Exact Audio Copy<br />
| logo =<br />
| screenshot = [[Image:EAC_screenshot.png|250px|EAC screenshot]]<br />
| caption = popular secure ripper with C2 error correction<br />
| maintainer = Andre Wiethoff<br />
| stable_release = 1.2 (13 Aug 2016)<br />
| preview_release = <br />
| operating_system = Windows, Linux/BSD (Wine Emulation)<br />
| use = Digital Audio Extraction<br />
| license = Proprietary, Cardware<br />
| website = [http://www.exactaudiocopy.org/ EAC website]<br />
}}<br />
<br />
'''Exact Audio Copy''' ('''EAC''' for short) is a freeware software that can be used to extract tracks from an Audio CD to your computer's hard disk. What makes EAC special compared to other rippers is the fact that it is capable of reading audio CDs almost perfectly.<br />
EAC uses various methods for extracting audio data. EAC can also invoke externally installed encoders, thereby making it possible to simultaneously rip and encode audio data to the format of your choice.<br />
<br />
== Features of Exact Audio Copy ==<br />
* Usage of the Windows 95 and Windows NT ASPI Interface, so both SCSI and ATAPI CD-ROM drives are supported<br />
* Hidden sector synchronization (jitter correction)<br />
* Secure, fast and burst extraction methods selectable. Fast extraction should run at the same speed as other grabbers, but is probably not exact anymore. Burst mode just grabs the audio data without any synchronization.<br />
* Read error and complete loss of sync detection and correction in secure modes, as far as possible<br />
* Output of time positions of all non-exact corrections and listen to these positions<br />
* Copy of ranges of music data, not only tracks<br />
* Automatic Speed reduction on errors and fallback afterwards<br />
* Normalization of extracted audio<br />
* Usage of the Windows Audio Compression Manager (ACM Codecs) for direct compression e.g. to MP3 waves<br />
* Support for the BladeEnc DLL that is usable like an ACM Codec for online MP3 compression<br />
* Support of external MP3, VQF, RA and AAC encoders for automatic compression after extraction<br />
* Batch compression and decompression of/to WAV files<br />
* Compression offset support for exact compression/decompression<br />
* Detection of pre-track gaps<br />
* Detection of silence in pre-track gaps<br />
* Automatic creation of CUE sheets for CDRWin, including all gaps, indices, track attributes, UPC and ISRC<br />
* CD player functionality and prelistening to selected ranges<br />
* Automatic detection of drive features, whether a drive has an accurate stream and/or does caching<br />
* Sample Offsets for drives with no accurate streams, including the option of filling up missing samples with silence<br />
* Option for synchronizing tracks for non-accurate stream drives<br />
* Filename editing with local and remote CDDB database and cdplayer.ini support and more features like ID3 tagging<br />
* Browse and edit local database<br />
* Local CDDB support<br />
* Record and Loop Record functions for recording from LP, radio, etc.<br />
* Automatic rename of MP3 files according to their ID3 tag<br />
* Catalog extraction function<br />
* Multisession (CD-Extra) support<br />
* CD-Text support<br />
* CD-Write support for some drives<br />
* ID3 Tag editor with drag and drop possibility from track listing and database<br />
* Glitch removal after extraction<br />
* Small WAV editor with the following functionality: delete, trim, normalize, pad, glitch removal, pop detection, interpolation of ranges, noise reduction, fade in/out, undo (and more)<br />
* Program is Cardware, so feel free to copy<br />
<br />
===Removed features===<br />
EAC 0.9 beta 1 (21 Jan 2001) through 0.95 prebeta 3 (11 May 2003) had manual TOC detection as an option, "useful if a CD is defective and displays wrong track positions or data tracks instead of audio; EAC will try to detect the CD structure by analysis." This could also be used to detect pre-emphasis and copyright flags in the subcode, since they're sometimes missing from the TOC. The manual TOC detection feature was removed in 0.95 prebeta 4 (9 Nov 2003) due to European legislation which would outlaw software capable of circumventing a certain type of CD copy protection involving erroneous TOC data.<ref>Andre said at the time: "The German magazine c't published [http://www.heise.de/ct/artikel/Die-Grenzen-des-Erlaubten-290330.html an article] [about] whether EAC is or is not violating a German law against circumvention of copy protections on audio CDs. Some of the experts they asked had the opinion that the function of retrieving the native TOC is at best working at the limit of legality. Due to that article and to eliminate any possibility of legal problems, I decided to remove that function (although I am pretty sure that it is absolutely legal). I always try to make sure to be fully compliant with German law, even if I would interpret the law absolutely differently."</ref><br />
<br />
A related feature, "retrieve native TOC", was available through 0.95 beta 3 (30 Aug 2005); it reloaded the TOC info from the lead-in, same as ejecting and reinserting the disc, but without losing metadata.<br />
<br />
EAC 1.0 beta 1 (23 Nov 2010) removed the following features:<br />
* Compression offset<br />
* ID3v1 tag editor<br />
* Support for pre-XP versions of Windows (95/98/Me/NT4/2000)<br />
<br />
EAC 1.0 beta 3 (22 Sep 2011) removed the option to not use null samples for CRC calculations.<br />
<br />
===Limitations===<br />
* The log for non-Test & Copy burst-mode rips will say "No errors occured"<!--yes, occured is misspelled--> on all tracks, but in this mode, EAC does not actually check for inconsistent data.<br />
* Pre-emphasis and copyright flags are only checked for in the TOC, which sometimes doesn't match the flags in the subcode. Usually the subcode is correct.<br />
* ISRC codes are sometimes read incorrectly.<ref>See http://www.studio-nibble.com/cd/index.php?title=Exact_Audio_Copy_(EAC)</ref><br />
<br />
== How it works ==<br />
=== Extraction technology ===<br />
In secure mode, this program reads every audio sector at least twice. That is one reason why the program is so slow. But by using this technique non-identical sectors are detected. If an error occurs (read or sync error), the program keeps on reading this sector, until eight of 16 retries are identical, but at maximum one, three or five times (according to the error recovery quality) these 16 retries are read. So, in the worst case, bad sectors are read up to 82 times! But this will help the program to obtain best result by comparing all of the retries. If it is not sure that the stream is correct (at least it can be said at approx. 99.5%) the program will tell the user where the (possible) read error occurred. The program also tries to adjust the jitter artifacts that occur on the first block of a track, so that each extraction should be exactly the same. On drives found to have the ''accurate stream'' feature, this is guaranteed. Of course, this is a little bit more complex, especially with some CD drives which have caching. When these drives cache audio data, every sector read will be read from cache and is identical. I initially implemented two ways of dealing with the caching problem. First there is an extra option for resetting the cache for use the the old secure mode (the one being kept for compatibility reasons). In the current beta version, the cache will still be reset by resetting the drive completely. You might imagine that this would slow down the reading process very badly.<br />
<br />
That is why it was implemented three new read modes in version 0.85beta. One really fast mode (up to half of maximum speed) is only for non-caching, accurate stream CD-ROM drives. The second one could be used for caching, accurate stream drives and the last one will work with drives that don't have accurate streams, or do caching. The last two will be much slower, when no read errors occur it will usually something around a third to a fourth of the drives maximum speed.<br />
For testing, it was used a Plextor 14/32 drive that does no caching and a Teac R56S-600 drive that does caching. Furthermore the Plextor 14/32 supports the ''accurate stream'' feature, so it produces no jitter artifacts on any stream.<br />
<br />
This program is really damn slow in secure mode in comparison with other grabbers, but the program checks every sector over and over to get the correct data with high certainty. If you don't like this feature of EAC and prefer fast copies instead of secure copies, you should use the fast or burst extraction option in the options menu. But of course in fast mode, the program will no longer be able to find read errors. Only if a read error occurs in a sector synchronization area, will a sync error will still be displayed. Fast mode is sector synchronized with 2 blocks of 23 as synchronization blocks. Burst copy is even worse, no synchronization is done, enabling extraction at maximum speed of the drive. No error checking of any kind can be performed. If the stream ever breaks, it will tell the user in the status report by showing up suspicious positions. Of course this is only heuristic; there needn't be any errors on that positions; moreover there could be errors that are not found at all.<br />
A new option for selecting the error recovery quality will determine how often these blocks of 16 reads will be done before giving up and working with the results obtained so far. For bad CDs, low error recovery quality will be fastest, but high recover quality should give best results.<br />
<br />
=== Gap technology ===<br />
In the new versions of EAC it is possible to detect pre-track gaps. These are the pauses between two tracks. Usually they are two seconds long and a CD player will display a negative time during this pause. By enabling the option ''Detect Pre-Track Gaps'' it will be possible to detect all gap-lengths by reading the sub-channel information. Because this information is not stored on the CD directly retrievable, EAC has to search for the position a track ends. This search is quite fast, but it still takes on average a second per track. That's why I made it possible to disable it in the options. Besides that option you can choose to add the gaps to the previous track nevertheless. Otherwise you can choose either to append the gap to the correct track or to leave it out . A benefit of performing the detection and getting the gap times is the selection of a range to copy. There the correct times will be displayed. One last word on this topic: Because these pre-track gaps are found by testing positions, it is possible that it will not be 100% exact. But in most cases it will be correct.<br />
<br />
=== Automatic feature detection technology ===<br />
From version 0.8 beta on it is possible to autodetect CD-ROM drive features. For each drive the program builds a separate drive options page. On this option page this function can be called.<br />
There are two different features that will be checked by EAC: First if the stream is accurate and second, if the drive caches audio data. Even if the drive has a cache (drive specifications), it does not automatically mean that the drive uses the cache for audio extractions.<br />
The test for the accurate stream feature should be always correct, but testing for cache will give some problems with drives that extract audio very slowly (under 4× speed). If results are uncertain (given e.g. two different results on different tests), you should assume that the drive does caching. The new secure mode for non-accurate and/or caching drives should work for all drives. The other new read modes are only a bit faster. If testing for accurate stream only sometimes gives a negative result, then you could nevertheless try to use the accurate secure mode. From version 0.8 beta on it is possible to autodetect CD-ROM drive features. For each drive the program builds a separate drive options page. On this option page this function can be called.<br />
<br />
=== Track synchronization technology ===<br />
Usually CD audio extraction programs will extract one track after another. This could cause some problems on CD-ROM drives which are not accurate, when using a CD which has no gaps. When this option is enabled in the EAC options, EAC will synchronize a track with a preceding track if there is no silence at the track junction, so track transitions will be free from jitter artefacts (e.g. on live recordings).<br />
<br />
=== Offset technology ===<br />
''Sample Offset'' is another feature of EAC, it will help to always get the same WAVs compared to a different reader and to prevent generation losses. Nearly all drives can not position the head correctly. That means if the program tells the drive to read block 10000 it will probably read data somewhere in block 9998 instead. But this is not visible to the reading program, it won't know if it is really the data it wanted. Usually the head will be set always to a fixed offset before or after the correct read position. So it is possible to detect this offset once and use it for all CDs coming afterwards. To find out the offset of any drive the offset has to be calculated relative to an absolute offset (reference offset).<br />
<br />
To implement this detection for all drives some bytes from common CDs (reference CDs) are used. These are the reference each CD-ROM drive has to compare with. Of course it was implemented only a limited selection of CDs that can be used to detect this offset. Sometimes there are different versions (releases) of the same CD, but only the same press like the one that was used will work. Furthermore, drives that have jitter are unable to position their heads correctly. So you should activate the secure or fast extraction method and moreover if your drive does caching, activate no-caching emulation. The ''Searching Track Start'' algorithm tries to find the correct start position even if jitter occurs. But this is not always possible, mainly if the drive jitters too much. But it can be shown that nearly 80% of the reads will get the same results. A drive's characteristic offset can be found automatically from the CD from on the list of reference CDs. Because of the mentioned jitter error the value given back is also not 100% sure. You should start the test several times and remember to activate emulate no-caching if necessary. Then you should get one value that occurs more often than other values. '''You should use this test on two different CDs at least! Both tests should give back the same value!'''<br />
As different models of common CD-R writer usually do not add the same offset on writing, it seems that also big CD manufactures also do not always press the same offset on their CDs. So it was determined the most common offset of pressed CDs and integrated it into the offset detection routines.<br />
Please help us measure more reference CDs. If you have a Plextor 14/32 32× CD-ROM drive, we know the offset. So all you have to do is run some popular disks from your own collection through it with a utility you could download here and send us the output.<br />
<br />
== Exact Audio Copy guides ==<br />
You can begin configuring EAC by starting with the Drive Configuration followed by the Gap Settings and finally, the Encoder Options. Remember to use only an original, factory-pressed Audio CD for configuring EAC. Please do not use, CD-Rs, CD-RWs, bootlegs or any such discs. Also use a non copy-protected disc which carries the familiar “Compact Disc-Digital Audio” logo.<br />
<br />
=== General guides ===<br />
* [[EAC Configuration Wizard]]<br />
* [[EAC configuration]]<br />
* [[EAC freedb/Database Options]]<br />
* [[EAC Drive Configuration]]<br />
* EAC [[Gap settings]]<br />
<br />
=== Compression guides ===<br />
* [[EAC and FLAC]]<br />
* [[EAC and Lame]]<br />
* [[EAC and AAC]] <br />
* [[EAC and Monkey's Audio]]<br />
* [[EAC and Musepack]]<br />
* [[EAC and Ogg Vorbis]]<br />
* [[EAC and TAK]]<br />
* [[EAC and WavPack]]<br />
* [[EAC and LossyWAV]]<br />
* [[EAC and QAAC]]<br />
* [[EAC and ALAC]]<br />
<br />
== See also ==<br />
* [[EAC release history]]<br />
* [[EAC and Cue Sheets]] ASCII formats explained<br />
* [[EAC Vs CDex SecureMode | EAC secure mode versus CDex full paranoia]] (by Pio2001)<br />
* [[REACT]] 2 integration for running EAC scripts<br />
<br />
== Notes ==<br />
<references/><br />
<br />
== External links ==<br />
* [http://www.digital-inn.de/forum271/ EAC forums]<br />
<br />
<br />
[[Category:CD Rippers]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Hydrogenaudio_Listening_TestsHydrogenaudio Listening Tests2016-08-14T23:12:35Z<p>Mjb: /* External Tests */ archive.org link adjustments. some ff123.net pages like mono.html went blank in late 2007 so I'm now linking to just prior to that time</p>
<hr />
<div>One of the most visible ways that HydrogenAudio members have shown their enthusiasm for audio quality and their respect for [[TOS 8|scientific principles]] over the years is by organizing and participating in public blind listening tests of lossy codecs and presenting statistical analyses of the results. These results show the advantages and disadvantages of different formats and encoders and help identify which are "state of the art."<br />
<br />
[[Private Listening Tests|Private listening tests]] also provide useful data, but the public HydrogenAudio tests are a rarity in having enough participants to both average out variations among individual listeners and still have statistically significant results.<br />
<br />
Note that a listening test cannot really compare formats or encoder "brands." Instead, it compares particular versions of particular encoders at particular bitrates. Results will differ with different encoders, newer versions of the same encoders, or different bitrates. Use caution when extrapolating, and use the most recent results when extrapolating to the newest encoder versions.<br />
<br />
'''Note:''' There would be no point in listening tests of [[lossless]] encoders; the decoded results are bit-identical to the original uncompressed recordings. [[Lossless comparison|Lossless encoder comparisons]] instead consider technical aspects such as compression ratio and encode/decode speed.<br />
<br />
All tests are sorted by date, newest first. All dates are in [http://www.cl.cam.ac.uk/~mgk25/iso-time.html ISO8601 format].<br />
<br />
==Tests and Results==<br />
{|class="wikitable" align="right"<br />
!colspan=2| Result Symbol Key<br />
|-<br />
| > || Better than<br />
|-<br />
| ~ || About the same as<br />
|-<br />
| ~> || About the same, but slightly better than<br />
|}<br />
<br />
===Multiformat Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#aaffff"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2014-07<br />
| 96-kbps<br>General<br />
| Kamedo2<br />
| [[Apple AAC]] (iTunes 11.2.2), [[Opus]] (1.1),<br>[[Vorbis]] ([[aoTuV]] Beta6.03), [[MP3]] ([[LAME]] 3.99.5)<br />
| Opus > Apple ><br />MP3(V5) ~ Vorbis<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=106354 HA Thread]<br>[http://listening-test.coresv.net/results.htm Complete Result]<br />
|-<br />
| 2011-04-10<br />
| 64-kbps<br>General<br />
| IgorC<br />
| [[Vorbis]] [[aoTuV]], [[QuickTime AAC|Quicktime]] HE-[[AAC]], [[Opus]]<br />
| Opus > Apple ><br />Nero ~ Vorbis<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=87785 HA Thread]<br>[http://listening-tests.hydrogenaud.io/igorc/results.html Complete Result]<br />
|-<br />
| 2007-08-16<br />
| 64-kbps<br>General<br />
| Sebastian Mares<br />
| [[Vorbis]] [[aoTuV]], [[Nero AAC]],<br>[[WMA]] Pro<br />
| Nero > WMA Pro ~ Vorbis<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=56397 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-64-1/results.htm Complete Result]<br />
|- <br />
| 2006-11-22<br />
| 48-kbps<br>General<br />
| Sebastian Mares<br />
| [[Vorbis]] [[aoTuV]], [[Nero AAC]],<br>[[WMA]] Pro, [[WMA]] Standard<br />
| Nero > WMA Pro ~ Vorbis > <br /> WMA Standard<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=50408 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-48-1/results.htm Complete Result]<br />
|-<br />
| 2006-01-13<br />
| 128-kbps<br>General<br />
| Sebastian Mares<br />
| [[QuickTime AAC]], [[Nero AAC]], [[LAME]] [[MP3]],<br>[[Vorbis]] [[aoTuV]], [[WMA]] Pro<br />
| 5-way tie<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=40607&view=findpost&p=357117 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-128-1/results.htm Complete Result]<br />
|}<br />
<br />
===[[AAC]] Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#ffaaaa"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2011-08-20<br />
| 96-kbps <br>General<br />
| IgorC<br />
| CT, [[Fraunhofer|FhG AAC]] via Winamp (not [[Fraunhofer FDK AAC|FDK]]), [[Nero AAC|Nero]], [[QuickTime AAC|QuickTime]] TVBR & CVBR<br />
| Quicktime CVBR ~> TVBR ~><br /> Fraunhofer > CT > Nero<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=89765 HA Thread]<br>[http://listening-tests.hydrogenaud.io/igorc/aac-96-a/results.html Complete result]<br />
|-<br />
| 2006-02-20<br />
| 48-kbps HE-AAC<br>General<br />
| Gabriel<br />
| 3gpp (v1), CT (v1 & v2), [[Nero AAC|Nero]] (v1 & v2)<br />
| All tie for most sample types;<br /> otherwise any v1 > any v2<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=42679&hl= HA Thread]<br>[http://www.mp3-tech.org/tests/aac_48/results.html Complete Result]<br />
|-<br />
| 2006-02-05<br />
| 48-kbps HE-AAC<br>Classical<br />
| Ivan Dimkovic<br />
| [[Nero AAC|Nero]] HE-AAC v1 & v2<br />
|<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=41191&hl= HA Thread]<br />
|}<br />
<br />
===[[MP3]] Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#aaffaa"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2008-10-17<br />
| 130-kbps<br>General<br />
| Sebastian Mares<br />
| [[LAME]] 3.97, [[LAME]] 3.98.2, [[iTunes]], [[Fraunhofer|FhG MP3]], [[Helix]]<br />
|<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=66564 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Complete Result]<br />
|}<br />
<br />
==External Tests==<br />
Other people have held listening tests in venues outside of Hydrogenaudio (although the organizers of the tests tend to be HA members :). The results of these tests are found below:<br />
<br />
* [https://web.archive.org/web/20070720024213/http://www.ff123.net/ ff123's site on audio testing and listening tests] (most recent test 2002-07-27)<br />
* [https://web.archive.org/web/20071014001946/http://www.rjamorim.com/test/ Roberto's Public Listening Tests] (most recent test 2004-07-11)<br />
* [http://listening-tests.hydrogenaud.io/sebastian/ Sebastian Mares' Listening Tests] (most recent test updated 2008-11-22)<br />
* [http://www.soundexpert.info/ SoundExpert Listening Tests] (continually updated)<br />
<br />
<br />
[[Category:Listening Tests]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=High_Definition_Compatible_DigitalHigh Definition Compatible Digital2016-08-07T04:14:27Z<p>Mjb: /* Links */ Keith typo fix</p>
<hr />
<div>{|class="wikitable" width="100%"<br />
! tl;dr version:<br />
| HDCD was (mostly) a scam, but thousands of popular CDs released from 1995-present have this encoding. ([[List of HDCD-encoded Compact Discs]])<br />
'''Do not batch-convert your lossless audio to 24-bit.''' Leave your lossless CD rips 16-bit and use an audio player capable of decoding HDCD, like [[Foobar2000]].<br />
|}<br />
<br />
'''High Definition Compatible Digital''', or '''HDCD''' is a Microsoft proprietary audio encode-decode process that claims to provide increased dynamic range over that of standard Redbook audio CDs, while retaining backward compatibility with existing Compact disc players. —[https://en.wikipedia.org/wiki/High_Definition_Compatible_Digital HDCD article at Wikipedia]<br />
<br />
Decoding the extra information required an HDCD-compatible player or Windows Media Player. There was no public documentation for the process, but it was eventually reverse engineered. Many HDCD-encoded CDs were released from the mid 1990s but started to disappear around 2008. Some CD's with HDCD codes are still appearing, because they were mastered using HDCD equipment, but do not use the core features of HDCD. Microsoft no longer advertises nor supports HDCD.<br />
<br />
A lossless copy of CD audio will include the HDCD data. See [[List of HDCD-encoded Compact Discs]], or the more complete, but less detailed [http://www.head-fi.org/t/65414/hdcd-list list of known HDCD compact discs] at Head-Fi.org<br />
<br />
== Function and features ==<br />
HDCD encodes a virtual 20 bits of range in a 16-bit stream. Peak extend is worth about one bit of additional range, while Low level gain adjustment is worth about three bits of additional range. HDCD encoding amplifies the audio stream by 6dB to start.<br />
<br />
;Peak extend (PE): The base 6dB amplification makes the lower levels louder, but the top 9dB is soft-limited, or "squashed", into the top 3dB in the 16-bit stream. When HDCD is being decoded, the top 9dB is reconstructed.<br />
;Low-level gain adjustment (LLE): The base 6dB amplification can be corrected down during quieter parts via HDCD control codes to restore the original low level. See [[#Regarding the Low-level Gain Adjustment feature|§Regarding the Low-level Gain Adjustment feature]].<br />
;Filters:There were to be two selectable playback filters, but the idea was already patented and so it couldn't be used in Pacific Microsonics or other licensed hardware decoders. Software decoders can detect the feature, but none use it.<br />
<br />
When playing the HDCD-CD in a regular CD player, a listener may hear the uncorrected distortion at the peaks, and the low-level remains uncorrected from the base 6dB amplification.<br />
<br />
* See a full technical examination by Jim Lesurf: [http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html Page 1] [http://www.audiomisc.co.uk/HFN/HDCD/Examined.html Page 2]<br />
<br />
== Decoding software ==<br />
As HDCD is a proprietary extension owned by Microsoft, Windows Media Player was the only software to support it for a long time. A simple closed-source Windows-only decoding tool, called hdcd.exe, appeared in 2007 on the Doom9 Forum, a product of reverse-engineering Windows Media Player. [http://forum.doom9.org/showthread.php?t=129136] Since that time, an open source implementation has come to exist based on this work. It supports the peak extend and gain HDCD features, while the transient filter feature is detected but not implemented.<br />
<br />
All of the open source decoding is based of the work of Christopher J. Key (original reverse-engineering), Chris Moeller (open implementation), and Gumboot (C-optimization). Benjamin Steffes simplified the code, by using some pre-computed tables, etc., for inclusion in FFmpeg. There may be slight variations in the output of the different tools.<br />
<br />
=== Audio players ===<br />
* Windows Media Player, but there is a bug where HDCD will not be enabled if the HDCD control signal is not detected near the beginning of a song<br />
* [[Foobar2000]] can decode HDCD to 20-bit PCM via [[Foobar2000:Components/HDCD Decoder (foo dsp hdcd)|foo_dsp_hdcd]] ([https://github.com/kode54/foo_hdcd/blob/master/hdcd_decode.c source])<br />
* [[dBpoweramp]] will decode HDCD to 24-bit PCM (uses the hdcd.exe tool for processing)<br />
* [[CUETools]]<br />
<br />
=== hdcd.exe ===<br />
The original Windows-only closed source tool posted on the Doom9 forums in 2007, by C.J. Key. It only works on wav.<br />
hdcd.exe -o OUT24.wav HDCD16.wav<br />
<br />
=== FFmpeg ===<br />
FFmpeg version 3.1's libavfilter supports a HDCD filter that will convert HDCD-encoded audio to PCM at up to 20-bit precision. The filter is based on the Foobar2000 component source code.<br />
<br />
'''Notice:''' There was a bug in FFmpeg (version 3.1.1 and earlier) that prevented low-level gain adjustment from working. It was fixed in [http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ba69a81019a2642969b108c39e3bea7d2f8ffbfa this commit].<br />
<br />
;Example:FLAC with HDCD encoded in 16-bit (perhaps ripped from a CD)<br />
ffmpeg -i input16.flac -af hdcd output24.flac<br />
;Example 2:Notice the output from the filter is truncated down to 16-bit because the wav muxer defaults to pcm_s16le...<br />
ffmpeg -i input16.wav -af hdcd output16.wav<br />
;Example 3:... if you want to use another format (like pcm_s24le), you have to specify it with the acodec option<br />
ffmpeg -i input16.wav -af hdcd -acodec pcm_s24le output24.wav<br />
<br />
* See [https://ffmpeg.org/ffmpeg-filters.html#hdcd FFmpeg &rarr; filters &rarr; hdcd]<br />
<br />
== Scanning a FLAC archive for HDCD using FFmpeg ==<br />
<br />
HDCD stats reporting was added after release 3.1.1. So, as of 30 July 2016, this script requires building ffmpeg from git. (<nowiki>git clone git://source.ffmpeg.org/ffmpeg</nowiki>) or using something like a [https://ffmpeg.zeranoe.com/builds/ Zeranoe FFmpeg build for Windows].<br />
<br />
;hdcdscan.sh:<br />
<pre><br />
#!/bin/bash<br />
<br />
# A bash script for scanning for files with HDCD encoding.<br />
# Burt P.<br />
#<br />
# Usage:<br />
# ./hdcdscan.sh *.flac<br />
# or<br />
# find /some/archive/path/ -name '*.flac' -exec ./hdcdscan.sh {} \;<br />
# or <br />
# find /some/archive/path/ -name '*.flac' -print0 |xargs -0 -P 4 -n 1 ./hdcdscan.sh<br />
# or (prolly best)<br />
# find /some/archive/path/ -name '*.flac' -print0 |xargs -0 -P 1 -n 50 ./hdcdscan.sh<br />
#<br />
<br />
#FFMPEG="/home/you/gits/ffmpeg/ffmpeg" # if using ffmpeg from git<br />
<br />
TDER="/run/shm" # temp directory<br />
TLIMIT=30 # scan the first N seconds, empty for no limit<br />
SIMPLE="y" # show only summary, empty for no<br />
ONLY_HDCD="y" # show only files with hdcd detected, empty for no<br />
CHECK_MODES="" # use both modes and see if md5 matches<br />
<br />
#----<br />
CPU_COUNT=$(grep -c ^processor /proc/cpuinfo)<br />
#CPU_COUNT=4 # manual<br />
<br />
if [ -z "$FFMPEG" ]; then<br />
FFMPEG=$(which ffmpeg)<br />
fi<br />
FILTERCHK=$("$FFMPEG" -filters 2>&1 | grep hdcd)<br />
if [ -z "$FILTERCHK" ]; then<br />
echo "$FFMPEG is not built with hdcd filter support"<br />
exit 1<br />
fi<br />
<br />
#FORMATSTR="-acodec pcm_s24le -f wav" # if using wav temp file<br />
FORMATSTR="-f s24le" # if using /dev/null<br />
<br />
scan_file() {<br />
local SF<br />
local TAG<br />
local P_TLIMIT<br />
TAG="$$_$1"<br />
SF="$2"<br />
P_TLIMIT=""<br />
if [ -n "$TLIMIT" ]; then P_TLIMIT="-t $TLIMIT"; fi<br />
<br />
if [ -f "$f" ]; then<br />
#TF="$TDER/hdcdout_$TAG.wav"<br />
TF="/dev/null"<br />
TFO="$TDER/hdcdout_$TAG.ffmpeg-out"<br />
<br />
echo "$f ..." >"$TFO"<br />
<br />
"$FFMPEG" -hide_banner -nostats -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd $FORMATSTR "$TF" 2>&1 | grep "_hdcd_" >>"$TFO"<br />
DETECTED=$(grep "HDCD detected: yes" "$TFO")<br />
if [ -n "$ONLY_HDCD" ]; then<br />
if [ -z "$DETECTED" ]; then echo -n "" >"$TFO"; fi<br />
fi<br />
if [ -n "$DETECTED" ]; then<br />
if [ -n "$CHECK_MODES" ]; then<br />
SUM1=$("$FFMPEG" -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd=process_stereo=0 $FORMATSTR md5: 2>/dev/null)<br />
SUM2=$("$FFMPEG" -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd=process_stereo=1 $FORMATSTR md5: 2>/dev/null)<br />
if [ "$SUM1" == "$SUM2" ]; then<br />
echo "md5 sums match: $SUM1" >>"$TFO"<br />
else<br />
echo "md5 sums differ: ps0: $SUM1, ps1: $SUM2" >>"$TFO"<br />
fi<br />
fi<br />
fi<br />
sed -i -e "s#^\[Parsed_hdcd_[0-9]\+ @ [0-9a-fx]\+\] ##" "$TFO"<br />
sed -i -e "s#^#[$TAG] #" "$TFO"<br />
if [ -n "$SIMPLE" ]; then<br />
head -n 1 "$TFO"<br />
if [ -n "$CHECK_MODES" ]; then grep "md5 sums " "$TFO"; fi<br />
grep "HDCD detected:" "$TFO"<br />
else<br />
cat "$TFO"<br />
fi<br />
<br />
if [ -f "$TFO" ]; then rm "$TFO"; fi<br />
if [ -f "$TF" ]; then rm "$TF"; fi<br />
fi<br />
}<br />
<br />
NN=0<br />
for f in "$@"<br />
do<br />
scan_file "$NN" "$f" &<br />
while [ $(jobs -r| wc -l) -ge "$CPU_COUNT" ] ; do sleep 0.2 ; done<br />
((NN++))<br />
done<br />
wait<br />
</pre><br />
<br />
== Technical notes ==<br />
<br />
=== Packet formats ===<br />
pe = peak extend (PE), tg = target gain (LLE), tf = transient filter<br />
<br />
;Packet format ''A'': 8-bit code, tg is a 3-bit value (-7.0dB to 0.0dB steps of 1dB). This {{discogs|3192807|HDCD Sampler (1992)}} is an example of a disc with this packet type.<br />
{| class="wikitable"<br />
| 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0<br />
|-<br />
| 0 || 0 || tf || pe || 0 ||colspan=3|tg<br />
|}<br />
<br />
;Packet format ''B'': 16-bit (8-bit code, 8-bit XOR of code), tg is a 4-bit value used as a 3.1 fixed-point number (-7.5dB to 0.0dB steps of 0.5dB). Most discs after 1995 use this packet type.<br />
{| class="wikitable"<br />
| 15 || 14 || 13 || 12 || 11 || 10 || 9 || 8 || || 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0<br />
|-<br />
| 0 || 0 || tf || pe ||colspan=4|tg || ||colspan=8| XOR check<br />
|}<br />
<br />
''A'' and ''B'' are unofficial names of the different formats based on counters in the FFmpeg HDCD filter source code. If using -v verbose with the filter, Counter A, B, C will be reported. A is the number of 8-bit format packets, B is the number of 16-bit format packets validated, C is total packets. almost_A is the number of packets that were supposed to be an A format, but one of the expected zeros was a one. checkfail_B is the number of packets that failed the XOR check for B format. In a perfect HDCD encoding A+B=C, likely as A+0=C or 0+B=C.<br />
<br />
== Interesting Notes ==<br />
<br />
===Regarding HDCD detection===<br />
The arrival of a valid packet for a channel resets a code detect timer for that channel. If both<br />
channels have active timers, then code is deemed to be present and the filter select data is<br />
considered valid immediately. However, any command data which would effect the level of the<br />
signal must match between the two channels in order to take effect. The primary reason for this is<br />
to handle the case where an error on one channel destroys the code. In such a case, the decoder<br />
will mistrack for a short time until the next command comes along, which is much less audible<br />
than a change in gain on only one channel, causing a shift in balance and lateral image<br />
movement. If either of the code detect timers times out, then code is deemed not to be present,<br />
and all commands are canceled, returning the decode system to its default state. If the conditions<br />
on the encoder side are not changing, then command packets are inserted on a regular basis to<br />
keep the code detect timers in the decoder active and to update the decoder if one starts playing a<br />
selection in the middle of a continuous recording. <br />
:&mdash; "extract from the AES paper presented by Keith Johnson" [https://hydrogenaud.io/index.php/topic,79427.msg900371.html#msg900371] paper:[http://www.goodwinshighend.com/music/hdcd/aes_paper.pdf]<br />
<br />
===Regarding the Low-level Gain Adjustment feature===<br />
There are two modes of Low Level Extension, “Normal” and “Special”. Normal mode begins<br />
to affect the input signal 45 dB below peak level, gradually raising the gain 4 dB as the<br />
level drops over an 18 dB range. Special mode begins to affect the input signal 39 dB<br />
below peak level, and gradually raises the gain 7.5 dB over a 26 dB range. Normal mode is<br />
optimized to provide the best combination of decoded dynamic range and resolution and<br />
undecoded compatibility. Special mode is designed to provide the best possible decoded<br />
dynamic range and resolution at some potential expense of undecoded compatibility. To<br />
access Special mode, from the Operating Menu select (SETUP/OUTPUT/HDCD_16/LOWLVL/<br />
SPECIAL). Typically, Special mode is used only for HDCD 16-bit master tracking with the<br />
assumption that the recording will be decoded by the Model Two to a 24-bit or 20-bit word<br />
length for digital post production before being re-encoded to HDCD 16-bit using Normal<br />
mode to produce a release master.<br />
:&mdash; "from PM operator's manual" <br />
If you see a level of greater than 4.0 of gain adjustment, there was an error made in the disc where the mastering engineer mistakenly used "Special Mode". This is not only wrong, but there is no consumer equipment that can even decode this level of gain adjustment! Only by playing this back through the PM Model One (44 and 48 kHz only) or the PM Model Two (added dual- and quad-rate sampling rates) could this file be properly decoded<br />
:&mdash; Charles Hansen [http://www.head-fi.org/t/65414/hdcd-list/570#post_12725140]<br />
<br />
===Regarding the Playback Filters feature===<br />
[T]he PM Model One and Model Two professional units, which were combination A/D and D/A converters) that had two different playback (reconstruction) filters for HDCD. While the PM A/D used two different anti-aliasing filters while performing A/D conversion (depending on the level of high-frequency content), they were precluded from using two different playback filters as Ed Meitner had already patented that idea for Museatex (now out of business).<br />
:&mdash; CHansen [http://www.head-fi.org/t/65414/hdcd-list/570#post_12725140]<br />
<br />
==Links==<br />
* [http://www.goodwinshighend.com/music/hdcd/aes_paper.pdf Compatible Resolution Enhancement in Digital Audio Systems], a paper presented to AES Convention 1996 by Keith Johnson<br />
* [https://hydrogenaud.io/index.php/topic,79427.msg737725.html#msg737725 CHansen describes HDCD] at HA forum</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=High_Definition_Compatible_DigitalHigh Definition Compatible Digital2016-08-07T04:14:10Z<p>Mjb: /* Links */ Hansen typo fix</p>
<hr />
<div>{|class="wikitable" width="100%"<br />
! tl;dr version:<br />
| HDCD was (mostly) a scam, but thousands of popular CDs released from 1995-present have this encoding. ([[List of HDCD-encoded Compact Discs]])<br />
'''Do not batch-convert your lossless audio to 24-bit.''' Leave your lossless CD rips 16-bit and use an audio player capable of decoding HDCD, like [[Foobar2000]].<br />
|}<br />
<br />
'''High Definition Compatible Digital''', or '''HDCD''' is a Microsoft proprietary audio encode-decode process that claims to provide increased dynamic range over that of standard Redbook audio CDs, while retaining backward compatibility with existing Compact disc players. —[https://en.wikipedia.org/wiki/High_Definition_Compatible_Digital HDCD article at Wikipedia]<br />
<br />
Decoding the extra information required an HDCD-compatible player or Windows Media Player. There was no public documentation for the process, but it was eventually reverse engineered. Many HDCD-encoded CDs were released from the mid 1990s but started to disappear around 2008. Some CD's with HDCD codes are still appearing, because they were mastered using HDCD equipment, but do not use the core features of HDCD. Microsoft no longer advertises nor supports HDCD.<br />
<br />
A lossless copy of CD audio will include the HDCD data. See [[List of HDCD-encoded Compact Discs]], or the more complete, but less detailed [http://www.head-fi.org/t/65414/hdcd-list list of known HDCD compact discs] at Head-Fi.org<br />
<br />
== Function and features ==<br />
HDCD encodes a virtual 20 bits of range in a 16-bit stream. Peak extend is worth about one bit of additional range, while Low level gain adjustment is worth about three bits of additional range. HDCD encoding amplifies the audio stream by 6dB to start.<br />
<br />
;Peak extend (PE): The base 6dB amplification makes the lower levels louder, but the top 9dB is soft-limited, or "squashed", into the top 3dB in the 16-bit stream. When HDCD is being decoded, the top 9dB is reconstructed.<br />
;Low-level gain adjustment (LLE): The base 6dB amplification can be corrected down during quieter parts via HDCD control codes to restore the original low level. See [[#Regarding the Low-level Gain Adjustment feature|§Regarding the Low-level Gain Adjustment feature]].<br />
;Filters:There were to be two selectable playback filters, but the idea was already patented and so it couldn't be used in Pacific Microsonics or other licensed hardware decoders. Software decoders can detect the feature, but none use it.<br />
<br />
When playing the HDCD-CD in a regular CD player, a listener may hear the uncorrected distortion at the peaks, and the low-level remains uncorrected from the base 6dB amplification.<br />
<br />
* See a full technical examination by Jim Lesurf: [http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html Page 1] [http://www.audiomisc.co.uk/HFN/HDCD/Examined.html Page 2]<br />
<br />
== Decoding software ==<br />
As HDCD is a proprietary extension owned by Microsoft, Windows Media Player was the only software to support it for a long time. A simple closed-source Windows-only decoding tool, called hdcd.exe, appeared in 2007 on the Doom9 Forum, a product of reverse-engineering Windows Media Player. [http://forum.doom9.org/showthread.php?t=129136] Since that time, an open source implementation has come to exist based on this work. It supports the peak extend and gain HDCD features, while the transient filter feature is detected but not implemented.<br />
<br />
All of the open source decoding is based of the work of Christopher J. Key (original reverse-engineering), Chris Moeller (open implementation), and Gumboot (C-optimization). Benjamin Steffes simplified the code, by using some pre-computed tables, etc., for inclusion in FFmpeg. There may be slight variations in the output of the different tools.<br />
<br />
=== Audio players ===<br />
* Windows Media Player, but there is a bug where HDCD will not be enabled if the HDCD control signal is not detected near the beginning of a song<br />
* [[Foobar2000]] can decode HDCD to 20-bit PCM via [[Foobar2000:Components/HDCD Decoder (foo dsp hdcd)|foo_dsp_hdcd]] ([https://github.com/kode54/foo_hdcd/blob/master/hdcd_decode.c source])<br />
* [[dBpoweramp]] will decode HDCD to 24-bit PCM (uses the hdcd.exe tool for processing)<br />
* [[CUETools]]<br />
<br />
=== hdcd.exe ===<br />
The original Windows-only closed source tool posted on the Doom9 forums in 2007, by C.J. Key. It only works on wav.<br />
hdcd.exe -o OUT24.wav HDCD16.wav<br />
<br />
=== FFmpeg ===<br />
FFmpeg version 3.1's libavfilter supports a HDCD filter that will convert HDCD-encoded audio to PCM at up to 20-bit precision. The filter is based on the Foobar2000 component source code.<br />
<br />
'''Notice:''' There was a bug in FFmpeg (version 3.1.1 and earlier) that prevented low-level gain adjustment from working. It was fixed in [http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ba69a81019a2642969b108c39e3bea7d2f8ffbfa this commit].<br />
<br />
;Example:FLAC with HDCD encoded in 16-bit (perhaps ripped from a CD)<br />
ffmpeg -i input16.flac -af hdcd output24.flac<br />
;Example 2:Notice the output from the filter is truncated down to 16-bit because the wav muxer defaults to pcm_s16le...<br />
ffmpeg -i input16.wav -af hdcd output16.wav<br />
;Example 3:... if you want to use another format (like pcm_s24le), you have to specify it with the acodec option<br />
ffmpeg -i input16.wav -af hdcd -acodec pcm_s24le output24.wav<br />
<br />
* See [https://ffmpeg.org/ffmpeg-filters.html#hdcd FFmpeg &rarr; filters &rarr; hdcd]<br />
<br />
== Scanning a FLAC archive for HDCD using FFmpeg ==<br />
<br />
HDCD stats reporting was added after release 3.1.1. So, as of 30 July 2016, this script requires building ffmpeg from git. (<nowiki>git clone git://source.ffmpeg.org/ffmpeg</nowiki>) or using something like a [https://ffmpeg.zeranoe.com/builds/ Zeranoe FFmpeg build for Windows].<br />
<br />
;hdcdscan.sh:<br />
<pre><br />
#!/bin/bash<br />
<br />
# A bash script for scanning for files with HDCD encoding.<br />
# Burt P.<br />
#<br />
# Usage:<br />
# ./hdcdscan.sh *.flac<br />
# or<br />
# find /some/archive/path/ -name '*.flac' -exec ./hdcdscan.sh {} \;<br />
# or <br />
# find /some/archive/path/ -name '*.flac' -print0 |xargs -0 -P 4 -n 1 ./hdcdscan.sh<br />
# or (prolly best)<br />
# find /some/archive/path/ -name '*.flac' -print0 |xargs -0 -P 1 -n 50 ./hdcdscan.sh<br />
#<br />
<br />
#FFMPEG="/home/you/gits/ffmpeg/ffmpeg" # if using ffmpeg from git<br />
<br />
TDER="/run/shm" # temp directory<br />
TLIMIT=30 # scan the first N seconds, empty for no limit<br />
SIMPLE="y" # show only summary, empty for no<br />
ONLY_HDCD="y" # show only files with hdcd detected, empty for no<br />
CHECK_MODES="" # use both modes and see if md5 matches<br />
<br />
#----<br />
CPU_COUNT=$(grep -c ^processor /proc/cpuinfo)<br />
#CPU_COUNT=4 # manual<br />
<br />
if [ -z "$FFMPEG" ]; then<br />
FFMPEG=$(which ffmpeg)<br />
fi<br />
FILTERCHK=$("$FFMPEG" -filters 2>&1 | grep hdcd)<br />
if [ -z "$FILTERCHK" ]; then<br />
echo "$FFMPEG is not built with hdcd filter support"<br />
exit 1<br />
fi<br />
<br />
#FORMATSTR="-acodec pcm_s24le -f wav" # if using wav temp file<br />
FORMATSTR="-f s24le" # if using /dev/null<br />
<br />
scan_file() {<br />
local SF<br />
local TAG<br />
local P_TLIMIT<br />
TAG="$$_$1"<br />
SF="$2"<br />
P_TLIMIT=""<br />
if [ -n "$TLIMIT" ]; then P_TLIMIT="-t $TLIMIT"; fi<br />
<br />
if [ -f "$f" ]; then<br />
#TF="$TDER/hdcdout_$TAG.wav"<br />
TF="/dev/null"<br />
TFO="$TDER/hdcdout_$TAG.ffmpeg-out"<br />
<br />
echo "$f ..." >"$TFO"<br />
<br />
"$FFMPEG" -hide_banner -nostats -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd $FORMATSTR "$TF" 2>&1 | grep "_hdcd_" >>"$TFO"<br />
DETECTED=$(grep "HDCD detected: yes" "$TFO")<br />
if [ -n "$ONLY_HDCD" ]; then<br />
if [ -z "$DETECTED" ]; then echo -n "" >"$TFO"; fi<br />
fi<br />
if [ -n "$DETECTED" ]; then<br />
if [ -n "$CHECK_MODES" ]; then<br />
SUM1=$("$FFMPEG" -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd=process_stereo=0 $FORMATSTR md5: 2>/dev/null)<br />
SUM2=$("$FFMPEG" -y -v verbose -i "$f" $P_TLIMIT -vn -af hdcd=process_stereo=1 $FORMATSTR md5: 2>/dev/null)<br />
if [ "$SUM1" == "$SUM2" ]; then<br />
echo "md5 sums match: $SUM1" >>"$TFO"<br />
else<br />
echo "md5 sums differ: ps0: $SUM1, ps1: $SUM2" >>"$TFO"<br />
fi<br />
fi<br />
fi<br />
sed -i -e "s#^\[Parsed_hdcd_[0-9]\+ @ [0-9a-fx]\+\] ##" "$TFO"<br />
sed -i -e "s#^#[$TAG] #" "$TFO"<br />
if [ -n "$SIMPLE" ]; then<br />
head -n 1 "$TFO"<br />
if [ -n "$CHECK_MODES" ]; then grep "md5 sums " "$TFO"; fi<br />
grep "HDCD detected:" "$TFO"<br />
else<br />
cat "$TFO"<br />
fi<br />
<br />
if [ -f "$TFO" ]; then rm "$TFO"; fi<br />
if [ -f "$TF" ]; then rm "$TF"; fi<br />
fi<br />
}<br />
<br />
NN=0<br />
for f in "$@"<br />
do<br />
scan_file "$NN" "$f" &<br />
while [ $(jobs -r| wc -l) -ge "$CPU_COUNT" ] ; do sleep 0.2 ; done<br />
((NN++))<br />
done<br />
wait<br />
</pre><br />
<br />
== Technical notes ==<br />
<br />
=== Packet formats ===<br />
pe = peak extend (PE), tg = target gain (LLE), tf = transient filter<br />
<br />
;Packet format ''A'': 8-bit code, tg is a 3-bit value (-7.0dB to 0.0dB steps of 1dB). This {{discogs|3192807|HDCD Sampler (1992)}} is an example of a disc with this packet type.<br />
{| class="wikitable"<br />
| 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0<br />
|-<br />
| 0 || 0 || tf || pe || 0 ||colspan=3|tg<br />
|}<br />
<br />
;Packet format ''B'': 16-bit (8-bit code, 8-bit XOR of code), tg is a 4-bit value used as a 3.1 fixed-point number (-7.5dB to 0.0dB steps of 0.5dB). Most discs after 1995 use this packet type.<br />
{| class="wikitable"<br />
| 15 || 14 || 13 || 12 || 11 || 10 || 9 || 8 || || 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0<br />
|-<br />
| 0 || 0 || tf || pe ||colspan=4|tg || ||colspan=8| XOR check<br />
|}<br />
<br />
''A'' and ''B'' are unofficial names of the different formats based on counters in the FFmpeg HDCD filter source code. If using -v verbose with the filter, Counter A, B, C will be reported. A is the number of 8-bit format packets, B is the number of 16-bit format packets validated, C is total packets. almost_A is the number of packets that were supposed to be an A format, but one of the expected zeros was a one. checkfail_B is the number of packets that failed the XOR check for B format. In a perfect HDCD encoding A+B=C, likely as A+0=C or 0+B=C.<br />
<br />
== Interesting Notes ==<br />
<br />
===Regarding HDCD detection===<br />
The arrival of a valid packet for a channel resets a code detect timer for that channel. If both<br />
channels have active timers, then code is deemed to be present and the filter select data is<br />
considered valid immediately. However, any command data which would effect the level of the<br />
signal must match between the two channels in order to take effect. The primary reason for this is<br />
to handle the case where an error on one channel destroys the code. In such a case, the decoder<br />
will mistrack for a short time until the next command comes along, which is much less audible<br />
than a change in gain on only one channel, causing a shift in balance and lateral image<br />
movement. If either of the code detect timers times out, then code is deemed not to be present,<br />
and all commands are canceled, returning the decode system to its default state. If the conditions<br />
on the encoder side are not changing, then command packets are inserted on a regular basis to<br />
keep the code detect timers in the decoder active and to update the decoder if one starts playing a<br />
selection in the middle of a continuous recording. <br />
:&mdash; "extract from the AES paper presented by Keith Johnson" [https://hydrogenaud.io/index.php/topic,79427.msg900371.html#msg900371] paper:[http://www.goodwinshighend.com/music/hdcd/aes_paper.pdf]<br />
<br />
===Regarding the Low-level Gain Adjustment feature===<br />
There are two modes of Low Level Extension, “Normal” and “Special”. Normal mode begins<br />
to affect the input signal 45 dB below peak level, gradually raising the gain 4 dB as the<br />
level drops over an 18 dB range. Special mode begins to affect the input signal 39 dB<br />
below peak level, and gradually raises the gain 7.5 dB over a 26 dB range. Normal mode is<br />
optimized to provide the best combination of decoded dynamic range and resolution and<br />
undecoded compatibility. Special mode is designed to provide the best possible decoded<br />
dynamic range and resolution at some potential expense of undecoded compatibility. To<br />
access Special mode, from the Operating Menu select (SETUP/OUTPUT/HDCD_16/LOWLVL/<br />
SPECIAL). Typically, Special mode is used only for HDCD 16-bit master tracking with the<br />
assumption that the recording will be decoded by the Model Two to a 24-bit or 20-bit word<br />
length for digital post production before being re-encoded to HDCD 16-bit using Normal<br />
mode to produce a release master.<br />
:&mdash; "from PM operator's manual" <br />
If you see a level of greater than 4.0 of gain adjustment, there was an error made in the disc where the mastering engineer mistakenly used "Special Mode". This is not only wrong, but there is no consumer equipment that can even decode this level of gain adjustment! Only by playing this back through the PM Model One (44 and 48 kHz only) or the PM Model Two (added dual- and quad-rate sampling rates) could this file be properly decoded<br />
:&mdash; Charles Hansen [http://www.head-fi.org/t/65414/hdcd-list/570#post_12725140]<br />
<br />
===Regarding the Playback Filters feature===<br />
[T]he PM Model One and Model Two professional units, which were combination A/D and D/A converters) that had two different playback (reconstruction) filters for HDCD. While the PM A/D used two different anti-aliasing filters while performing A/D conversion (depending on the level of high-frequency content), they were precluded from using two different playback filters as Ed Meitner had already patented that idea for Museatex (now out of business).<br />
:&mdash; CHansen [http://www.head-fi.org/t/65414/hdcd-list/570#post_12725140]<br />
<br />
==Links==<br />
* [http://www.goodwinshighend.com/music/hdcd/aes_paper.pdf Compatible Resolution Enhancement in Digital Audio Systems], a paper presented to AES Convention 1996 by Kieth Johnson<br />
* [https://hydrogenaud.io/index.php/topic,79427.msg737725.html#msg737725 CHansen describes HDCD] at HA forum</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Titleformat_ExamplesFoobar2000:Titleformat Examples2016-01-06T13:45:27Z<p>Mjb: /* Album artist and album title, with fallbacks */ formatting</p>
<hr />
<div>{{fb2k}}<br />
These are some examples of general title format usage contributed by users. They may be of utility to others using Masstagger or other components. Feel free to sign up and contribute your own examples!<br />
<br />
Please make sure that you rejoin scripts that have been split into multiple lines before pasting them into the masstagger window. The reason that they are split is to keep this page's formatting readable in your browser.<br />
<br />
==Shorter examples==<br />
<br />
===Return corresponding tag field===<br />
%tag%<br />
* Example: If artist field is ''blah'', %artist% will return ''blah''.<br />
* Note: You can insert any character (or space) in between two tags, in front or after; so, if %artist% is ''blah'' and %title% is ''bleh'': ''%artist%X%title%'' returns ''blahXbleh''.<br />
<br />
===Trunctuate %tag% to a length of X characters===<br />
$cut(%tag%,X)<br />
* Example: If artist field is ''blah'', $cut(%artist%,3) returns ''bla''<br />
<br />
===Truncate %tag% by X characters, and add ... at the end of the cut===<br />
$cut(%tag%,X)...<br />
* Example: If artist field is ''blah'', ''$cut(%artist%,3)...'' returns ''bla...''<br />
<br />
===Return numerical value of %tag%, and pad with 0s to X characters===<br />
$num(%tag%,X)<br />
* Example: If %tracknumber% field is ''3'', ''$num(%tracknumber%,2)'' will return ''03''. If ''13'', it will return ''13''.<br />
<br />
===Return first two characters of a filename, and display as number (if present) padded with 0s to X characters===<br />
$num($left(%_filename%),2)<br />
* Example: A filename of ''03_artist_title.mpc'' will return ''03''.<br />
<br />
===Find first occurrence of character X in %tag%, and return everything in front of X===<br />
$puts(spacer,$strchr(%tag%,X))<br />
$trim($left(%tag%,$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
<br />
==Longer examples==<br />
<br />
In the next few strings, I have decided to make it possible to define the %tag% that should be edited and the character or string that is used to determine where to trunctuate; these can be defined as variables in the beginning of the string as $puts(tag,%tag%), $puts(char,X), etc. Basically the reason I have done this is to make it simpler to edit these strings, to what you want them to do at that exact moment, in the rather narrow masstager input field. That way it is possible to enter the needed tags and characters only once in the beginning of the line. Again, simply replace %tag% and X by the desired values. Also all of these strings will trim off the trailing and leading spaces of the output (in case there are any).<br />
<br />
===Find first occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
* Note: this does exactly the same as the last string mentioned above, except for the introdution of the two variables in the front, meant for easy editing (see explanation above).<br />
<br />
===Find last occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' returns ''blah'', and ''blah X bleh X bluh'' returns ''blah X bleh''<br />
<br />
===Find first occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bleh X bluh''<br />
<br />
===Find last occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bluh''<br />
<br />
===Find first occurence of character X and last occurence of character Y, and return everything in-between===<br />
$puts(char1,X)$puts(char2,Y)$puts(tag,%tag%)<br />
$puts(spacer1,$strchr($get(tag),$get(char1)))<br />
$puts(spacer2,$strrchr($get(tag),$get(char2)))<br />
$trim($substr($get(tag),$add($get(spacer1),1),$sub($get(spacer2),1)))<br />
* Example: ''blah X bleh Y bluh'' returns ''bleh''<br />
* Note: In most cases, ''X'' will probably be equal to ''y'' here.<br />
<br />
===Find first occurence of string XYZ, and return everything in front of string XYZ===<br />
$puts(string,XYZ)$puts(tag,%tag%)$puts(spacer,$strstr($get(tag),<br />
$get(string)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah XYZ bleh'' returns ''blah''<br />
* String ''XYZ'' can basically be any combination of characters or words.<br />
* If the string isn't found, everything is returned<br />
<br />
===Find first occurence of string XYZ in %tag% field, and return everything after XYZ:===<br />
$puts(string,XYZ)$puts(tag,%tag%)<br />
$puts(spacer,$strstr($get(tag),$get(string)))<br />
$trim($right($get(tag),$sub($len($get(tag)),<br />
$add($get(spacer),$len($get(string))))))<br />
* Example: ''blah XYZ bleh'' returns ''bleh''<br />
<br />
===Get everything between two strings of your choice===<br />
<!-- Credit: herojoker in hydrogenaudio.org/forums/index.php?showtopic=89453 --><br />
Assuming a text accessible via %someTag% contains the strings ''<coolTag>'' and ''<blaTag>'', in that order, you can get everything between them (e.g. ''xyz'' from ''<coolTag>xyz<blaTag>'') using this code:<br />
$substr(%someTag%,$add($strstr(%someTag%,<coolTag>),$len(<coolTag>)),$sub($strstr(%someTag%,<blaTag>),1))<br />
What does it do, and how?<br />
* ''$substr(%someTag%,X,Y)'' yields everything of %someTag% from the Xth character to the Yth character. In this case we have:<br />
* X = ''$add($strstr(%someTag%,<coolTag>),$len(<coolTag>))'',<br />
: i.e. the position of ''<coolTag>'' in %someTag% plus the length of the word ''<coolTag>''<br />
* Y = ''$sub($strstr(%someTag%,<blaTag>),1)''<br />
: i.e. the position of ''<blaTag>'' in %someTag% minus one; the subtraction is performed because otherwise the code would yield ''<'' (the first character of ''<blaTag>'') as the last character of the output string.<br />
<br />
===Test whether %tag% field contains string XYZ===<br />
$puts(string,XYZ)<br />
$puts(tag,%tag%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string)<br />
<br />
An example of how this could be used:<br />
$puts(string,rock)<br />
$puts(tag,%genre%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,genre includes $get(string),genre does not include $get(string))<br />
<br />
* With a track that has genre set to ''classic rock'', the output would be ''genre includes rock''.<br />
* With a track that has genre set to ''electronic dance'', the output would be ''genre does not include rock''.<br />
<br />
Note that this will also return the false value if the field is missing or empty. The following can provide a third output in that scenario instead:<br />
$puts(string,XYZ)<br />
$puts(tag,[%tag%])<br />
$if($get(tag),$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string),tag is missing or empty)<br />
<br />
==Custom columns for playlists==<br />
<br />
===ReplayGain tag summary===<br />
<br />
If album and track gain tags are present, it shows album gain followed by "alb", then track gain followed by "trk". If only track gain is present, it shows track gain is followed by "trk only". If neither tag is present, it shows "n/a". Remove the text-dimming angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre>$if($or(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_ALBUM_GAIN%),<br />
$if(%REPLAYGAIN_ALBUM_GAIN%,%REPLAYGAIN_ALBUM_GAIN%' '<'alb'><br />
$if($not(%REPLAYGAIN_TRACK_GAIN%),<' only'>)' ')<br />
$if(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_TRACK_GAIN% <'trk'><br />
$if(%REPLAYGAIN_ALBUM_GAIN%,, <'only'>)),n/a)</pre><br />
<br />
===Artist and title with fallback for untagged files===<br />
<br />
Shows artist, en dash, title in curly quotes, plus an optional note taken from the filename. Artist and title are read from tags if both are available, otherwise from the filename (in which case the artist is 'unknown' and title is the filename, unless the filename has a dash surrounded by spaces, assumed to be in the format ''artist - title''). If the file name ends with a bracketed note, e.g. ''Artist - Title [intro skips badly].mp3'', the note is appended to the output. Additionally, in the title, the text ''-inch'', or the double quote in ''7"'' and ''12"'', is replaced with the Unicode inch character, ''″''.<br />
<br />
Remove the text-dimming and highlighting angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre><br />
$puts(FILENAME,%filename%)<br />
$puts(TMP,$strstr($get(FILENAME), - ))<br />
$ifgreater($get(TMP),0,<br />
$puts(ARTIST,$trim($left($get(FILENAME),$sub($get(TMP),1))))<br />
$puts(TITLE,$trim($right($get(FILENAME),$sub($len($get(FILENAME)),$add($get(TMP),2)))))<br />
$puts(TITLEONLY,$left($get(TITLE),$sub($strstr($get(TITLE),' ['),1)))<br />
$puts(NOTE,$substr($get(TITLE),$add($len($get(TITLEONLY)),2),$strrchr($get(TITLE),']'))),<br />
$puts(ARTIST,unknown)<br />
$puts(TITLE,$get(FILENAME))<br />
$puts(TITLEONLY,$get(TITLE))<br />
)<br />
$puts(BESTARTIST,$if([$meta(artist)],$meta(artist),$get(ARTIST)))<br />
$puts(BESTTITLE,$if3([$meta(title)],$meta(title),[$get(TITLEONLY)],unknown))<br />
$puts(FORMATTEDTITLE,$replace($replace($replace($get(BESTTITLE),-inch,″),12",12″),7",7″))<br />
>$get(BESTARTIST)<<br />
< – “><br />
$get(FORMATTEDTITLE)<”><br />
$if($get(NOTE),<< $get(NOTE)>>)<br />
</pre><br />
<br />
==Playlist grouping schemes==<br />
<br />
===Album artist and album title, with fallbacks ===<br />
<br />
With this grouping scheme, tracks with album tags are kept separate from streams and other loose tracks. The album artist is taken from %band%, %album artist%, or %artist%, otherwise 'unknown artist'.<br />
<br />
<pre>$if($stricmp($left(%path%,7),'http://'),<Internet streams>,<br />
$if($meta_test(album),<br />
$if($meta_test(band),%band%,<br />
$if($meta_test(album artist),%album artist%,<br />
$if($meta_test(artist),%artist%,unknown artist))) – %album%,<br />
<non-album tracks>))<br />
</pre></div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Titleformat_ExamplesFoobar2000:Titleformat Examples2016-01-06T13:44:55Z<p>Mjb: +a couple of my favorite playlist examples</p>
<hr />
<div>{{fb2k}}<br />
These are some examples of general title format usage contributed by users. They may be of utility to others using Masstagger or other components. Feel free to sign up and contribute your own examples!<br />
<br />
Please make sure that you rejoin scripts that have been split into multiple lines before pasting them into the masstagger window. The reason that they are split is to keep this page's formatting readable in your browser.<br />
<br />
==Shorter examples==<br />
<br />
===Return corresponding tag field===<br />
%tag%<br />
* Example: If artist field is ''blah'', %artist% will return ''blah''.<br />
* Note: You can insert any character (or space) in between two tags, in front or after; so, if %artist% is ''blah'' and %title% is ''bleh'': ''%artist%X%title%'' returns ''blahXbleh''.<br />
<br />
===Trunctuate %tag% to a length of X characters===<br />
$cut(%tag%,X)<br />
* Example: If artist field is ''blah'', $cut(%artist%,3) returns ''bla''<br />
<br />
===Truncate %tag% by X characters, and add ... at the end of the cut===<br />
$cut(%tag%,X)...<br />
* Example: If artist field is ''blah'', ''$cut(%artist%,3)...'' returns ''bla...''<br />
<br />
===Return numerical value of %tag%, and pad with 0s to X characters===<br />
$num(%tag%,X)<br />
* Example: If %tracknumber% field is ''3'', ''$num(%tracknumber%,2)'' will return ''03''. If ''13'', it will return ''13''.<br />
<br />
===Return first two characters of a filename, and display as number (if present) padded with 0s to X characters===<br />
$num($left(%_filename%),2)<br />
* Example: A filename of ''03_artist_title.mpc'' will return ''03''.<br />
<br />
===Find first occurrence of character X in %tag%, and return everything in front of X===<br />
$puts(spacer,$strchr(%tag%,X))<br />
$trim($left(%tag%,$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
<br />
==Longer examples==<br />
<br />
In the next few strings, I have decided to make it possible to define the %tag% that should be edited and the character or string that is used to determine where to trunctuate; these can be defined as variables in the beginning of the string as $puts(tag,%tag%), $puts(char,X), etc. Basically the reason I have done this is to make it simpler to edit these strings, to what you want them to do at that exact moment, in the rather narrow masstager input field. That way it is possible to enter the needed tags and characters only once in the beginning of the line. Again, simply replace %tag% and X by the desired values. Also all of these strings will trim off the trailing and leading spaces of the output (in case there are any).<br />
<br />
===Find first occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' or ''blah X bleh X bluh'' returns ''blah'' (ie.: artist_album_title -----> title, in case X is _ )<br />
* Note: this does exactly the same as the last string mentioned above, except for the introdution of the two variables in the front, meant for easy editing (see explanation above).<br />
<br />
===Find last occurence of character X in %tag%, and return everything in front of X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah X bleh'' returns ''blah'', and ''blah X bleh X bluh'' returns ''blah X bleh''<br />
<br />
===Find first occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bleh X bluh''<br />
<br />
===Find last occurence of character X in %tag% field, and return everything after X===<br />
$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))<br />
$trim($right($get(tag),<br />
$sub($len($get(tag)),$get(spacer))))<br />
* Example: ''blah X bleh'' returns ''bleh'', and ''blah X bleh X bluh'' returns ''bluh''<br />
<br />
===Find first occurence of character X and last occurence of character Y, and return everything in-between===<br />
$puts(char1,X)$puts(char2,Y)$puts(tag,%tag%)<br />
$puts(spacer1,$strchr($get(tag),$get(char1)))<br />
$puts(spacer2,$strrchr($get(tag),$get(char2)))<br />
$trim($substr($get(tag),$add($get(spacer1),1),$sub($get(spacer2),1)))<br />
* Example: ''blah X bleh Y bluh'' returns ''bleh''<br />
* Note: In most cases, ''X'' will probably be equal to ''y'' here.<br />
<br />
===Find first occurence of string XYZ, and return everything in front of string XYZ===<br />
$puts(string,XYZ)$puts(tag,%tag%)$puts(spacer,$strstr($get(tag),<br />
$get(string)))<br />
$trim($left($get(tag),$sub($get(spacer),1)))<br />
* Example: ''blah XYZ bleh'' returns ''blah''<br />
* String ''XYZ'' can basically be any combination of characters or words.<br />
* If the string isn't found, everything is returned<br />
<br />
===Find first occurence of string XYZ in %tag% field, and return everything after XYZ:===<br />
$puts(string,XYZ)$puts(tag,%tag%)<br />
$puts(spacer,$strstr($get(tag),$get(string)))<br />
$trim($right($get(tag),$sub($len($get(tag)),<br />
$add($get(spacer),$len($get(string))))))<br />
* Example: ''blah XYZ bleh'' returns ''bleh''<br />
<br />
===Get everything between two strings of your choice===<br />
<!-- Credit: herojoker in hydrogenaudio.org/forums/index.php?showtopic=89453 --><br />
Assuming a text accessible via %someTag% contains the strings ''<coolTag>'' and ''<blaTag>'', in that order, you can get everything between them (e.g. ''xyz'' from ''<coolTag>xyz<blaTag>'') using this code:<br />
$substr(%someTag%,$add($strstr(%someTag%,<coolTag>),$len(<coolTag>)),$sub($strstr(%someTag%,<blaTag>),1))<br />
What does it do, and how?<br />
* ''$substr(%someTag%,X,Y)'' yields everything of %someTag% from the Xth character to the Yth character. In this case we have:<br />
* X = ''$add($strstr(%someTag%,<coolTag>),$len(<coolTag>))'',<br />
: i.e. the position of ''<coolTag>'' in %someTag% plus the length of the word ''<coolTag>''<br />
* Y = ''$sub($strstr(%someTag%,<blaTag>),1)''<br />
: i.e. the position of ''<blaTag>'' in %someTag% minus one; the subtraction is performed because otherwise the code would yield ''<'' (the first character of ''<blaTag>'') as the last character of the output string.<br />
<br />
===Test whether %tag% field contains string XYZ===<br />
$puts(string,XYZ)<br />
$puts(tag,%tag%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string)<br />
<br />
An example of how this could be used:<br />
$puts(string,rock)<br />
$puts(tag,%genre%)<br />
$ifgreater($strstr($get(tag),$get(string)),0,genre includes $get(string),genre does not include $get(string))<br />
<br />
* With a track that has genre set to ''classic rock'', the output would be ''genre includes rock''.<br />
* With a track that has genre set to ''electronic dance'', the output would be ''genre does not include rock''.<br />
<br />
Note that this will also return the false value if the field is missing or empty. The following can provide a third output in that scenario instead:<br />
$puts(string,XYZ)<br />
$puts(tag,[%tag%])<br />
$if($get(tag),$ifgreater($strstr($get(tag),$get(string)),0,tag contains string,tag does not contain string),tag is missing or empty)<br />
<br />
==Custom columns for playlists==<br />
<br />
===ReplayGain tag summary===<br />
<br />
If album and track gain tags are present, it shows album gain followed by "alb", then track gain followed by "trk". If only track gain is present, it shows track gain is followed by "trk only". If neither tag is present, it shows "n/a". Remove the text-dimming angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre>$if($or(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_ALBUM_GAIN%),<br />
$if(%REPLAYGAIN_ALBUM_GAIN%,%REPLAYGAIN_ALBUM_GAIN%' '<'alb'><br />
$if($not(%REPLAYGAIN_TRACK_GAIN%),<' only'>)' ')<br />
$if(%REPLAYGAIN_TRACK_GAIN%,%REPLAYGAIN_TRACK_GAIN% <'trk'><br />
$if(%REPLAYGAIN_ALBUM_GAIN%,, <'only'>)),n/a)</pre><br />
<br />
===Artist and title with fallback for untagged files===<br />
<br />
Shows artist, en dash, title in curly quotes, plus an optional note taken from the filename. Artist and title are read from tags if both are available, otherwise from the filename (in which case the artist is 'unknown' and title is the filename, unless the filename has a dash surrounded by spaces, assumed to be in the format ''artist - title''). If the file name ends with a bracketed note, e.g. ''Artist - Title [intro skips badly].mp3'', the note is appended to the output. Additionally, in the title, the text ''-inch'', or the double quote in ''7"'' and ''12"'', is replaced with the Unicode inch character, ''″''.<br />
<br />
Remove the text-dimming and highlighting angle brackets if you're not using this in a Default UI playlist column.<br />
<br />
<pre><br />
$puts(FILENAME,%filename%)<br />
$puts(TMP,$strstr($get(FILENAME), - ))<br />
$ifgreater($get(TMP),0,<br />
$puts(ARTIST,$trim($left($get(FILENAME),$sub($get(TMP),1))))<br />
$puts(TITLE,$trim($right($get(FILENAME),$sub($len($get(FILENAME)),$add($get(TMP),2)))))<br />
$puts(TITLEONLY,$left($get(TITLE),$sub($strstr($get(TITLE),' ['),1)))<br />
$puts(NOTE,$substr($get(TITLE),$add($len($get(TITLEONLY)),2),$strrchr($get(TITLE),']'))),<br />
$puts(ARTIST,unknown)<br />
$puts(TITLE,$get(FILENAME))<br />
$puts(TITLEONLY,$get(TITLE))<br />
)<br />
$puts(BESTARTIST,$if([$meta(artist)],$meta(artist),$get(ARTIST)))<br />
$puts(BESTTITLE,$if3([$meta(title)],$meta(title),[$get(TITLEONLY)],unknown))<br />
$puts(FORMATTEDTITLE,$replace($replace($replace($get(BESTTITLE),-inch,″),12",12″),7",7″))<br />
>$get(BESTARTIST)<<br />
< – “><br />
$get(FORMATTEDTITLE)<”><br />
$if($get(NOTE),<< $get(NOTE)>>)<br />
</pre><br />
<br />
==Playlist grouping schemes==<br />
<br />
===Album artist and album title, with fallbacks ===<br />
<br />
With this grouping scheme, tracks with album tags are kept separate from streams and other loose tracks. The album artist is taken from %band%, %album artist%, or %artist%, otherwise 'unknown artist'.<br />
<br />
$if($stricmp($left(%path%,7),'http://'),<Internet streams>,<br />
$if($meta_test(album),<br />
$if($meta_test(band),%band%,<br />
$if($meta_test(album artist),%album artist%,<br />
$if($meta_test(artist),%artist%,unknown artist))) – %album%,<br />
<non-album tracks>))</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T11:30:23Z<p>Mjb: /* Syntax */ fixes to previous</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters. The script always outputs a text string (which can be empty).<br />
<br />
A '''comment''' is a line starting with two slashes, e.g. ''// this is a comment''.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Any other text is '''literal text'''. In literal text, the character ''%'', ''$'', ''['', '']'', or ''&apos;'' (apostrophe/single quote) must be escaped by enclosing it in ''&apos;'' (apostrophe/single quote) characters. For example, ''&apos;[&apos;'' (a left bracket in single quotes) results in a literal ''['' (left bracket). As a special case, ''&apos;&apos;'' (two single quotes in a row) results in one single quote. In the playlist, ''&lt;'' and ''>'' are also special; see [[#Dimmed and highlighted text]].<br />
<br />
When the script is evaluated, the output string is assembled by evaluating the function parameters, function calls, and field references. Comments and line break characters (CR and LF/newline) are ignored; to output a line break, use ''$crlf()''. Each field reference becomes the field's value, as a string. Each function becomes a string or number, and/or a truth value (not output) which can be used by another function.<br />
<br />
'''Note: the interface for entering custom columns and grouping schemes for the Default UI playlist does not support line breaks; scripts must be written all on one line, without comments.'''<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T11:08:45Z<p>Mjb: /* Syntax */ more redundant evaluation info removed</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters. The script always outputs a text string (which can be empty).<br />
<br />
A '''comment''' is a line starting with two slashes, e.g. ''// this is a comment''.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Any other text is '''literal text'''. In literal text, the character ''%'', ''$'', ''['', '']'', or ''&apos;'' (apostrophe/single quote) must be escaped by prefacing it with ''&apos;'' (apostrophe/single quote). The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' (single quote followed by left bracket) results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
In the playlist, ''&lt;'' and ''>'' are also special and must be escaped; see [[#Playlist]].<br />
<br />
When the script is evaluated, the output string is assembled by evaluating the function parameters, function calls, and field references. Comments and line break characters (CR and LF/newline) are ignored; to output a line break, use ''$crlf()''. Each field reference becomes the field's value, as a string. Each function becomes a string or number, and/or a truth value (not output) which can be used by another function.<br />
<br />
'''Note: the interface for entering custom columns and grouping schemes for the Default UI playlist does not support line breaks; scripts must be written all on one line, without comments.'''<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T11:06:57Z<p>Mjb: /* Syntax */ +caveat</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters. The script always outputs a text string (which can be empty).<br />
<br />
A '''comment''' is a line starting with two slashes, e.g. ''// this is a comment''.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''. It evaluates to a string or number.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Any other text is '''literal text'''. In literal text, the character ''%'', ''$'', ''['', '']'', or ''&apos;'' (apostrophe/single quote) must be escaped by prefacing it with ''&apos;'' (apostrophe/single quote). The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' (single quote followed by left bracket) results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
In the playlist, ''&lt;'' and ''>'' are also special and must be escaped; see [[#Playlist]].<br />
<br />
When the script is evaluated, the output string is assembled by evaluating the function parameters, function calls, and field references. Comments and line break characters (CR and LF/newline) are ignored; to output a line break, use ''$crlf()''. Each field reference becomes the field's value, as a string. Each function becomes a string or number, and/or a truth value (not output) which can be used by another function.<br />
<br />
'''Note: the interface for entering custom columns and grouping schemes for the Default UI playlist does not support line breaks; scripts must be written all on one line, without comments.'''<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T10:51:18Z<p>Mjb: /* Syntax */ character...it</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters. The script always outputs a text string (which can be empty).<br />
<br />
A '''comment''' is a line starting with two slashes, e.g. ''// this is a comment''.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''. It evaluates to a string or number.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Any other text is '''literal text'''. In literal text, the character ''%'', ''$'', ''['', '']'', or ''&apos;'' (apostrophe/single quote) must be escaped by prefacing it with ''&apos;'' (apostrophe/single quote). The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' (single quote followed by left bracket) results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
In the playlist, ''&lt;'' and ''>'' are also special and must be escaped; see [[#Playlist]].<br />
<br />
When the script is evaluated, the output string is assembled by evaluating the function parameters, function calls, and field references. Comments and line break characters (CR and LF/newline) are ignored; to output a line break, use ''$crlf()''. Each field reference becomes the field's value, as a string. Each function becomes a string or number, and/or a truth value (not output) which can be used by another function.<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T10:50:27Z<p>Mjb: /* Syntax */ rearranged so pure syntax comes first, then evaluation info</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters. The script always outputs a text string (which can be empty).<br />
<br />
A '''comment''' is a line starting with two slashes, e.g. ''// this is a comment''.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''. It evaluates to a string or number.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Any other text is '''literal text'''. In literal text, the characters ''%'', ''$'', ''['', '']'', or ''&apos;'' (apostrophe/single quote) must be escaped by prefacing it with ''&apos;'' (apostrophe/single quote). The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' (single quote followed by left bracket) results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
In the playlist, ''&lt;'' and ''>'' are also special and must be escaped; see [[#Playlist]].<br />
<br />
When the script is evaluated, the output string is assembled by evaluating the function parameters, function calls, and field references. Comments and line break characters (CR and LF/newline) are ignored; to output a line break, use ''$crlf()''. Each field reference becomes the field's value, as a string. Each function becomes a string or number, and/or a truth value (not output) which can be used by another function.<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T10:22:06Z<p>Mjb: /* Syntax */ +more info about functions</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters.<br />
<br />
'''Literal text''' is displayed as-is, except the characters ''%'', ''$'', ''['', '']'', and ''&apos;'' (apostrophe/single quote). In the playlist, ''&lt;'' and ''>'' are also special; see [[#Playlist]]. The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
<br />
'''Line break characters''' (CR and LF/newline) are ignored. To output a line break, use ''$crlf()''.<br />
<br />
A '''comment''' is a line starting with ''//''. Comments are ignored.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. A parameter can be literal text, a field reference, or another function call. Each function returns a string or number, and/or a truth value which can be used by another function. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T10:08:44Z<p>Mjb: tightened up & copy edited intro</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references, plus additional documentation about fields and functions which can only be used in specific components or which are provided by specific components.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see the [[Foobar2000:Query_syntax|Query Syntax]] article.<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters.<br />
<br />
'''Literal text''' is displayed as-is, except the characters ''%'', ''$'', ''['', '']'', and ''&apos;'' (apostrophe/single quote). In the playlist, ''&lt;'' and ''>'' are also special; see [[#Playlist]]. The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
<br />
'''Line break characters''' (CR and LF/newline) are ignored. To output a line break, use ''$crlf()''.<br />
<br />
A '''comment''' is a line starting with ''//''. Comments are ignored.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T10:05:55Z<p>Mjb: rearranged intro, added Syntax, consolidated metadata, adjusted headings, made numerous copy edits and minor additions</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in title formatting functions and field references with special meaning. References to documentation about fields and function which can only be used in specific components or which are provided by specific components can be found at the end of this article.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of title format syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see: [[Foobar2000:Query_syntax|Query Syntax]].<br />
<br />
== Syntax ==<br />
<br />
A title formatting script consists of any combination of literal text, field references, function calls, comments, and line break characters.<br />
<br />
'''Literal text''' is displayed as-is, except the characters ''%'', ''$'', ''['', '']'', and ''&apos;'' (apostrophe/single quote). In the playlist, ''&lt;'' and ''>'' are also special; see [[#Playlist]]. The single quote designates the next character as literal text, so for example:<br />
* ''&apos;['' results in a literal ''[''<br />
* ''&apos;&apos;'' (two single quotes in a row) results in one single quote.<br />
<br />
'''Line break characters''' (CR and LF/newline) are ignored. To output a line break, use ''$crlf()''.<br />
<br />
A '''comment''' is a line starting with ''//''. Comments are ignored.<br />
<br />
A '''field reference''' is a field name enclosed in percent signs, for example ''%artist%''.<br />
<br />
A '''function call''' starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty—denoted as ''()''—or contain one or more parameters separated by commas, for example ''$abbr(%artist%)''. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
== Arithmetic functions ==<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* ''c3po'' → 0<br />
* ''4.8'' → 4<br />
* ''-12'' → -12<br />
* ''- 12'' → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
== Boolean functions ==<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
== Control flow functions ==<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
== String functions ==<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$cut('abc123',3)'' → abc<br />
* ''$cut('abc123',0)'' → (nothing)<br />
* ''$cut('abc123',-1)'' → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* ''$left('abc123',3)'' → abc<br />
* ''$left('abc123',0)'' → (nothing)<br />
* ''$left('abc123',-1)'' → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* ''$num(123,5)'' → 00123<br />
* ''$num(-123,5)'' → -0123<br />
* ''$num(4.8,5)'' → 00004<br />
* ''$num(A1,5)'' → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
== Track info fields and functions ==<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
=== Metadata fields and functions ===<br />
<br />
Generally, metadata from the files (whether in tags or a cue sheet) is mapped directly to a field which can be referenced case-insensitively. For example, the first tag named ''URL'' can be referenced as ''%url%'', and the first standard comment tag can be referenced as ''%comment%''.<br />
<br />
The following functions are also available for accessing metadata:<br />
<br />
==== $meta(name) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
==== $meta(name,n) ====<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
==== $meta_sep(name,sep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
==== $meta_sep(name,sep,lastsep) ====<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
==== $meta_test(...) ====<br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
==== $meta_num(name) ====<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
=== Remapped metadata fields ===<br />
<br />
The following fields have special remapped values to make writing title format scripts more convenient:<br />
<br />
==== %album artist% ====<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
==== %album% ====<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
==== %artist% ====<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
==== %discnumber% ====<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %totaldiscs% ====<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
==== %track artist% ====<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
==== %title% ====<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
==== %tracknumber% ====<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
==== %track number% ====<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
=== Technical information fields ===<br />
<br />
==== %bitrate% ====<br />
Bitrate of the track in kilobits per second. VBR files will show a dynamic display for currently played track (outside of the playlist).<br />
<br />
==== %channels% ====<br />
Number of channels in the track, as text; either "mono", "stereo" for 1 or 2 channels, respectively, otherwise a number followed by "ch", e.g. "6ch".<br />
<br />
==== %codec% ====<br />
Name of codec used to encode the track, e.g. PCM, FLAC, MP3, or AAC. If exact codec name is not available, file extension is used. The Default UI's standard Codec column displays the same info, but sometimes adds details, e.g. "MP3 / VBR V2" or "AAC / LC".<br />
<br />
==== %filesize% ====<br />
The exact file size in bytes.<br />
Old version: <code>%_filesize%</code><br />
<br />
==== %filesize_natural% ====<br />
The approximate file size, automatically formatted in appropriate units such as megabytes or kilobytes, e.g. "8.49 MB"<br />
<br />
==== %length% ====<br />
The length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
==== %length_ex% ====<br />
The length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
==== %length_seconds% ====<br />
The length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
==== %length_seconds_fp% ====<br />
The length of the track in seconds as a floating point number.<br />
<br />
==== %length_samples% ====<br />
The length of the track in samples.<br />
<br />
==== %samplerate% ====<br />
Sample rate of the track, in Hz.<br />
<br />
=== Technical information functions ===<br />
<br />
==== $info(name) ====<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
==== $channels() ====<br />
The number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
==== %replaygain_album_gain% ====<br />
The ReplayGain album gain value.<br />
<br />
==== %replaygain_album_peak% ====<br />
The ReplayGain album peak value.<br />
<br />
==== %replaygain_track_gain% ====<br />
The ReplayGain track gain value.<br />
<br />
==== %replaygain_track_peak% ====<br />
The ReplayGain track peak value.<br />
<br />
=== Special fields ===<br />
<br />
==== %filename% ====<br />
The filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
The filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
The name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
The date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
The complete path, including the filename and extension.<br />
<br />
==== %_path_raw% ====<br />
The path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
The subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
A string representing the version of foobar2000.<br />
<br />
== Time and date functions ==<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
== Variable operations ==<br />
<br />
Variables can be used to store strings and numbers. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
<br />
=== $get(name) ===<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined.<br />
<br />
=== $put(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered.<br />
<br />
=== $puts(name,value) ===<br />
Stores ''value'' in the variable ''name'' and returns nothing.<br />
<br />
== Component-specific fields and functions ==<br />
<br />
This section lists fields and functions which are specific to certain components. Unless otherwise stated, the fields and functions are only usable in the context of those components.<br />
<br />
=== Now playing info ===<br />
<br />
The following fields related to the currently playing item are only usable in certain locations outside of the playlist, e.g. in the status bar, the main window title and the copy command script.<br />
<br />
==== %playback_time% ====<br />
The elapsed time formatted as [HH:]MM:SS.<br />
<br />
==== %playback_time_seconds% ====<br />
The elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
==== %playback_time_remaining% ====<br />
The time remaining until the track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
==== %playback_time_remaining_seconds% ====<br />
The time remaining until the track ends, in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== Playlist-only fields ===<br />
<br />
The following fields are only usable in playlist display formatting (i.e., the column title formatting patterns).<br />
<br />
==== %isplaying% ====<br />
"1" if file is currently playing, empty string otherwise.<br />
<br />
==== %ispaused% ====<br />
"1" if playback is paused, empty string otherwise.<br />
<br />
==== %list_index% ====<br />
A zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
==== %list_total% ====<br />
The number of items in the playlist.<br />
<br />
==== %queue_index% ====<br />
Index of the specified item in the playback queue. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
==== %queue_indexes% ====<br />
List of indexes of the specified item in the playback queue. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
==== %queue_total% ====<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
=== Playlist text color ===<br />
<br />
==== Dimmed and highlighted text ====<br />
<br />
In the Default UI playlist, text color can be adjusted by enclosing it in angle-brackets. The only options are to make the text dimmer (mixing the default color with black) or brighter (mixing the default color with the highlight color):<br />
<br />
* ''&lt;text>'' – dim ''text''<br />
* ''&lt;&lt;text>>'' – dimmer ''text''<br />
* ''&lt;&lt;&lt;text>>>'' – dimmest ''text''<br />
* ''>text&lt;'' – bright ''text''<br />
* ''>>text&lt;&lt;'' – brighter ''text''<br />
* ''>>>text&lt;&lt;&lt;'' – brightest ''text''<br />
<br />
==== Historical and Columns UI color functions ====<br />
<br />
Prior to version 1.0, the default UI playlist supported the following color functions, which are still available in the Columns UI playlist:<br />
<br />
===== $blend(color1,color2,part,total) =====<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
===== $hsl() =====<br />
Resets the text color to the default color.<br />
<br />
===== $hsl(h,s,l) =====<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
===== $hsl(h1,s1,l1,h2,s2,l2) =====<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
===== $rgb() =====<br />
Resets the text color to the default color.<br />
<br />
===== $rgb(r,g,b) =====<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
===== $rgb(r1,g1,b1,r2,g2,b2) =====<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
===== $transition(string,color1,color2) =====<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
=== Album List ===<br />
<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
<br />
=== Playback Statistics ===<br />
<br />
The foo_playcount component adds a number of fields for playback statistics and ratings. The fields can be used anywhere track info can be displayed. See the documentation for details:<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
=== Playlist Organizer ===<br />
<br />
This component adds a number of fields to control the display of a list of playlists. See the documentation for details:<br />
* [[Foobar2000:Components/Playlist Organizer (foo_plorg)#Nodes|Playlist Organizer: Nodes Title Formatting]]<br />
<br />
=== Columns UI ===<br />
<br />
This component replaces the Default UI framework, including the playlist. See the documentation for details:<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
== Additional Reading ==<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2016-01-06T06:33:38Z<p>Mjb: /* Additional Reading */ probably safe to assume 64-bit Windows these days</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in titleformatting functions and field references with special meaning. References to documentation about fields and function which can only be used in specific components or which are provided by specific components can be found at the end of this article.<br />
<br />
A field reference is a field name enclosed in percent signs, for example ''%artist%''. A function call starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty - denoted as ''()'' - or contain one or more parameters separated by commata, for example ''$abbr(%artist%)''. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of titleformat syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see: [[Foobar2000:Query_syntax|Query Syntax]].<br />
<br />
= Field remappings =<br />
<br />
Some of the fields accessible through ''%name%'' are remapped to other values to make writing titleformat scripts more convenient.<br />
<br />
== Metadata ==<br />
<br />
=== %album artist% ===<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
=== %album% ===<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
=== %artist% ===<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
=== %discnumber% ===<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
=== %totaldiscs% ===<br />
Index of total discs specified tracks belong to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
=== %track artist% ===<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
=== %title% ===<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
=== %tracknumber% ===<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
=== %track number% ===<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
== Technical information ==<br />
<br />
=== %bitrate% ===<br />
Bitrate of the track; includes dynamic VBR bitrate display for currently played track.<br />
<br />
=== %channels% ===<br />
Number of channels in the track (mono/stereo/etc). Returns the number of channels in text form; returns "mono" and "stereo" instead of "1" and "2".<br />
<br />
=== %filesize% ===<br />
Defined as ''%_filesize%''. Returns the filesize in bytes.<br />
<br />
=== %filesize_natural% ===<br />
Size of the file, automatically formatted in appropriate units such as megabytes or kilobytes. <br />
<br />
=== %samplerate% ===<br />
Sample rate of the track, in Hz.<br />
<br />
=== %codec% ===<br />
Name of codec used to encode the track. If exact codec name is not available, file extension is used.<br />
<br />
== Special fields ==<br />
<br />
= Control flow =<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
= Arithmetic functions =<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* "c3po" → 0<br />
* "4.8" → 4<br />
* "-12" → -12<br />
* "- 12" → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
= Boolean functions =<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
= Color functions =<br />
<br />
==For the Default User Interface==<br />
Starting in version 1.0, the Default UI playlist view doesn't support color functions. In that location, text color can only be adjusted via angle-bracket syntax: Use < and > characters to make specific text <dimmed> ''vs.'' the default color or >highlight<ed with the highlight color, with up to three levels in each case, ''e.g.'': <dimmed>, >highlight<, >>more highlight<<, <<<very dim>>>.<br />
<br />
==For Columns UI==<br />
<br />
The playlist in the Columns UI still supports the following functions:<br />
<br />
=== $blend(color1,color2,part,total) ===<br />
<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
=== $hsl() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $hsl(h,s,l) ===<br />
<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
=== $hsl(h1,s1,l1,h2,s2,l2) ===<br />
<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
=== $rgb() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $rgb(r,g,b) ===<br />
<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
=== $rgb(r1,g1,b1,r2,g2,b2) ===<br />
<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
=== $transition(string,color1,color2) ===<br />
<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
= Now playing info =<br />
The following functions and fields are usable for scripts used with the currently playing item, for example the status bar, the main window title and the copy command script. Please note that these special fields will ''not'' work in custom columns.<br />
<br />
== Special fields ==<br />
<br />
=== %playback_time% ===<br />
Returns the elapsed time formatted as [HH:]MM:SS.<br />
<br />
=== %playback_time_seconds% ===<br />
Returns elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
=== %playback_time_remaining% ===<br />
Returns remaining time until track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
=== %playback_time_remaining_seconds% ===<br />
Returns remaining time in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== %length% ===<br />
Returns the length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
=== %length_ex% ===<br />
Returns the length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
=== %length_seconds% ===<br />
Returns the length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
=== %length_seconds_fp% ===<br />
Returns the length of the track in seconds as floating point number.<br />
<br />
=== %length_samples% ===<br />
Returns the length of the track in samples.<br />
<br />
= Playlist info =<br />
The following functions and fields are usable for playlist display formatting (eg. per-column title formatting patterns).<br />
<br />
== Special fields ==<br />
<br />
=== %isplaying% ===<br />
<br />
Returns "1" if file is currently playing and empty string otherwise.<br />
<br />
=== %ispaused% ===<br />
<br />
Returns "1" if playback is paused, empty string otherwise.<br />
<br />
=== %list_index% ===<br />
<br />
Returns a zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
=== %list_total% ===<br />
<br />
Returns number of items in the playlist.<br />
<br />
=== %queue_index% ===<br />
<br />
Index of the specified item in the playback queue; available in playlist only. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
=== %queue_indexes% ===<br />
<br />
List of indexes of the specified item in the playback queue; available in playlist only. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
=== %queue_total% ===<br />
<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
= String functions =<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* $cut('abc123',3) → abc<br />
* $cut('abc123',0) → (nothing)<br />
* $cut('abc123',-1) → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* $left('abc123',3) → abc<br />
* $left('abc123',0) → (nothing)<br />
* $left('abc123',-1) → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* $num(123,5) → 00123<br />
* $num(-123,5) → -0123<br />
* $num(4.8,5) → 00004<br />
* $num(A1,5) → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest(s,...sN) ===<br />
<br />
Returns the first shortest element of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
= Track info =<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
== Metadata ==<br />
<br />
=== $meta(name) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
=== $meta(name,n) ===<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
=== $meta_sep(name,sep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
=== $meta_sep(name,sep,lastsep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
=== $meta_test(...) === <br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
=== $meta_num(name) ===<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
== Technical information ==<br />
<br />
=== $info(name) ===<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
=== $channels() === <br />
Returns number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
=== %replaygain_album_gain% ===<br />
<br />
Returns ReplayGain album gain value.<br />
<br />
=== %replaygain_album_peak% ===<br />
<br />
Returns ReplayGain album peak value.<br />
<br />
=== %replaygain_track_gain% ===<br />
<br />
Returns ReplayGain track gain value.<br />
<br />
=== %replaygain_track_peak% ===<br />
<br />
Returns ReplayGain track peak value.<br />
<br />
== Special fields ==<br />
<br />
==== %filename% ====<br />
<br />
Returns the filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
<br />
Returns the filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
<br />
Returns the name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
<br />
Returns the date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
<br />
Returns the path.<br />
<br />
==== %_path_raw% ====<br />
<br />
Returns the path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
<br />
Returns the subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
Returns a string representing the version of foobar2000.<br />
<br />
= Time/Date Functions =<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
= Variable operations =<br />
<br />
Variables can be used to store strings and number. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
=== $get(name) ===<br />
<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined<br />
<br />
=== $put(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered<br />
<br />
=== $puts(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns nothing<br />
<br />
= Component-provided fields and functions on tracks =<br />
<br />
This section lists components that provide additional fields and functions that are useable in the context of any track.<br />
<br />
== Playback statistics ==<br />
<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
= Component-specific fields and functions =<br />
<br />
This section lists components that provide additional fields and functions that are only usable in the context of the particular component.<br />
<br />
== Album list ==<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
== Playlist Organizer ==<br />
* [http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Playlist_Organizer_(foo_plorg)#Nodes Playlist Organizer: Nodes Title Formatting]<br />
<br />
== Columns UI ==<br />
<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
= Additional Reading =<br />
<br />
* [[Foobar2000:Title Formatting Introduction|Introduction to titleformat scripts]]<br />
* The file '''titleformat_help.html''' in your Foobar2000 directory, e.g. file:///C:/Program%20Files%20(x86)/foobar2000/titleformat_help.html<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Preferences:Default_User_Interface:Playlist_ViewFoobar2000:Preferences:Default User Interface:Playlist View2016-01-06T06:04:18Z<p>Mjb: link to Foobar2000:Title Formatting Introduction</p>
<hr />
<div>{{fb2k prefs|Foobar2000-Preferences-default-ui-playlistview.png|Playlist View}}<br />
This preferences page allows you to manage custom columns and grouping schemes for the Playlist View of the Default User Interface.<br />
== Custom Columns ==<br />
<br />
Custom columns are user-configured columns which can be displayed in the Playlist View of the Default User Interface in addition to the built-in columns. The table in upper part of the preferences page contains the configured custom columns. Each row represents on custom column which is defined by three properties.<br />
<br />
;Name<br />
: The name of the column is displayed in header of the column in the playlist view. A custom column can have the same name as a built-in column or as another custom column. However this might be confusing.<br />
;Pattern<br />
: The [[Foobar2000:Title Formatting Introduction|title formatting expression]] which defines the content of the column. This expression is evaluated for each track in the playlist. The result is displayed in the playlist view. The expression may contain a limited form of markup to dim or highlight parts of the test. See the section "Dimming and Highlighting Text" below for details.<br />
;Alignment<br />
: The horizontal alignment of the column determines whether the column is displayed left-aligned, right-aligned or centered.<br />
<br />
The built-in columns are hard-coded in the Default User Interface and cannot be changed. They also support features like icons in the "Playing" column which are not available for custom columns.<br />
<br />
=== Editing Custom Columns ===<br />
<br />
The following editing functions are available for custom columns. Some functions can be accessed through the context menu of the custom columns table or through keyboard shortcuts when the custom column table has the focus.<br />
<br />
;Add a custom column<br />
: Click the "Add New" button above the custom column table. Alternatively, press Ctrl+N or choose "Add New Entry" from the context menu. Double-clicking an empty entry also works. You can immediately edit the pattern of the added column.<br />
;Remove a custom colum<br />
: Click the "Remove" button above the custom column table to remove the selected custom column. Alternatively, press Del or choose "Delete Entry" from the context menu.<br />
;Change name<br />
: Click the name field of the entry. Alternatively, press Shift+F2 or choose "Edit Name" from the context menu. Press Return or Enter to confirm your changes or press Esc to discard them.<br />
;Change format<br />
: Click the format field of the entry. Alternatively, press F2 or choose "Edit Pattern" from the context menu. Press Return or Enter to confirm your changes or press Esc to discard them.<br />
;Change alignment<br />
: Click the alignment field of the entry and choose the desired alignment. Alternatively, choose the desired alignment from the "Alignment" submenu of the context menu.<br />
<br />
=== Dimming and Highlighting Text ===<br />
<br />
Parts of the displayed text in a custom column can be dimmed or highlighted using the characters < and >. Dimming and highlighting are both available in three levels. The color of dimmed text will be a blend of the text color and the background color. The color of highlighted text will be a blend of the text color and the highlight color. See the preferences page [[Foobar2000:Preferences:Default User Interface:Colors and Fonts|Colors and Fonts]] for details.<br />
<br />
The following table shows examples for the available markups. The examples assume that the text color is black, the background color is white and the highlight color is blue.<br />
<br />
{| border="1" cellpadding="5" cellspacing="3"<br />
| Text with markup || Displayed text<br />
|-<br />
| >>>strongly highlighted<<< || style="background: #ffffff; color: #0000ff;" | strongly highlighted<br />
|-<br />
| >>highlighted<< || style="background: #ffffff; color: #0000aa;" | highlighted<br />
|-<br />
| >weakly highlighted< || style="background: #ffffff; color: #000055;" | weakly highlighted<br />
|-<br />
| normal || style="background: #ffffff; color: #000000;" | normal<br />
|-<br />
| <weakly dimmed> || style="background: #ffffff; color: #404040;" | weakly dimmed<br />
|-<br />
| <<dimmed>> || style="background: #ffffff; color: #808080;" | dimmed<br />
|-<br />
| <<<strongly dimmed>>> || style="background: #ffffff; color: #c0c0c0;" | strongly dimmed<br />
|}<br />
<br />
=== Examples ===<br />
<br />
==== Duration with Milliseconds ====<br />
<br />
A custom column to display the duration. This is just like the built-in "Duration" column but displays milliseconds as well.<br />
; Name : Duration (ms)<br />
; Pattern : <code>%length_ex%</code><br />
; Alignment : right<br />
<br />
==== Disc and Track Number ====<br />
<br />
A custom column to display the track number, with disc number (if available), and an indicator of whether the track is currently playing. The spaces in the pattern are important. The musical note character (&#x266b;) is only supported in some fonts. If you don't want to change your font you could replace it with a large bullet (•).<br />
; Name : Track no (extended)<br />
; Pattern : <code>$if(%isplaying%,$char(9835) )[%discnumber% | ][%tracknumber%]</code><br />
; Alignment : right<br />
<br />
== Custom Grouping Schemes ==<br />
<br />
Custom grouping schemes are user-configured grouping schemes which can be used in the Playlist View of the Default User Interface in addition to the built-in grouping schemes. A grouping scheme defines how tracks in the playlist are grouped together and what the names of the groups are. The table in the lower part of the preferences page contains the configured grouping schemes. Each row represents a grouping scheme which is defined by two properties.<br />
<br />
;Name<br />
: The name of the grouping scheme is displayed in the context menu of the Playlist View header. A custom grouping scheme can have the same name as a built-in grouping scheme or as another custom grouping scheme. However this might be confusing.<br />
;Pattern<br />
: The title formatting expression which defines the name of the groups. This expression is evaluated for each track in the playlist. Neighboring tracks with the same result will be displayed as a single group. The result is displayed as the group header. Note that dimming and highlighting is not available for group headers. They are always displayed in the highlight color. Also note that the pattern can only access information from the tracks themselves. The special fields <code>%list_total%</code> and <code>%list_index%</code> are undefined when used in a custom grouping scheme.<br />
<br />
The built-in grouping schemes are hard-coded in the Default User Interface and cannot be changed.<br />
<br />
=== Editing Custom Grouping Schemes ===<br />
<br />
The following editing functions are available for custom custum grouping schemes. Some functions can be accessed through the context menu of the custom grouping schemes table or through keyboard shortcuts when the custom grouping schemes table has the focus.<br />
<br />
; Add a custom grouping scheme<br />
: Click the "Add New" button above the custom grouping scheme table. Alternatively, press Ctrl+N or choose "Add New Entry" from the context menu. Double-clicking an empty entry also works. You can immediately edit the pattern of the added grouping scheme.<br />
; Remove a custom colum<br />
: Click the "Remove" button above the custom grouping scheme table to remove the selected custom grouping scheme. Alternatively, press Del or choose "Delete Entry" from the context menu.<br />
; Change name<br />
: Click the name field of the entry. Alternatively, press Shift+F2 or choose "Edit Name" from the context menu. Press Return or Enter to confirm your changes or press Esc to discard them.<br />
; Change format<br />
: Click the format field of the entry. Alternatively, press F2 or choose "Edit Pattern" from the context menu. Press Return or Enter to confirm your changes or press Esc to discard them.<br />
<br />
=== Examples ===<br />
<br />
==== Albums, single tracks and streams ====<br />
A grouping scheme to have separate groups for Internet streams, songs with album tags, and songs without album tags.<br />
; Pattern : <code>$if($stricmp($left(%path%,7),'http&#58;//'),Internet streams,$if2(%album artist%,Non-album tracks)[ – %album%])</code><br />
<br />
== Links ==<br />
<br />
* [[Foobar2000:Title Formatting Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-12-14T02:24:55Z<p>Mjb: minor rephrasing for consistency</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
| width="95px" style="background: #00FFFF" | [https://www.poikosoft.com/ EZ CD Audio Converter]<br />
|-<br />
!colspan="15" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #00FF00" | yes (TOC+subcode){{ref|XLDpe|p}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (subcode)<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | for error detection only{{ref|EZCDAC|n}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | FUA(?) in rare circumstances{{ref|EZCDAC|o}}<br />
|-<br />
!colspan="15" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
| style="background: #FFFFFF" | n/a<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
| style="background: #00FF00" | freedb, MusicBrainz, GD3<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
| style="background: #CCFFCC" | free (30 days), then $39.95 or €39.95<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #CCFFCC" | proprietary<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where possible errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
*{{note|EZCDAC|n}} In its two error-detection modes, EZ CD Audio Converter uses C2 pointers to know where possible errors are, but it does not re-read; it just logs the track as being ripped with errors. Likewise, despite being advertised as a "secure" ripper, it only uses CRC mismatch or sync errors to note the presence of possible errors; it does not try to get consistent results by re-reading.<br />
*{{note|EZCDAC|o}} In EZ CD Audio Converter, the drive's caching is disabled only when error detection mode #2 is used on a drive which reports that it does not support Accurate Stream.<br />
*{{note|XLDpe|p}} XLD detects pre-emphasis in the TOC since version 2009/11/8 and in subcode since version 2014/4/27.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers. A C2 pointer is a flag pointing to a particular byte in the audio data, indicating whether the drive suspects there was a read error which could not be corrected. This suspicion is based on the CD's built-in CIRC error detection and correction information.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, an error-indicating C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration. The lack of an error-indicating C2 pointer may be used by some rippers (such as EAC and XLD) as a reason to prevent re-reads.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
The CIRC system on audio CDs is not foolproof; a very tiny percentage of uncorrectable errors can fail to result in error-indicating C2 pointers, especially in error-heavy areas of a disc. Also, some drive firmware simply doesn't reliably report errors in the C2 pointers, for reasons unknown.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-12-14T02:18:06Z<p>Mjb: /* Comparison chart */ +Poikosoft EZ CD Audio Converter, as per its website and a cursory test on my own system. +XLD pre-emphasis info from http://tmkk.undo.jp/xld/index_e.html</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
| width="95px" style="background: #00FFFF" | [https://www.poikosoft.com/ EZ CD Audio Converter]<br />
|-<br />
!colspan="15" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #00FF00" | yes (TOC+subcode){{ref|XLDpe|p}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (subcode)<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | for error detection only{{ref|EZCDAC|n}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | FUA(?) in rare circumstances{{ref|EZCDAC|o}}<br />
|-<br />
!colspan="15" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
| style="background: #FFFFFF" | n/a<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
| style="background: #00FF00" | freedb, MusicBrainz, GD3<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
| style="background: #CCFFCC" | free (30 days), then $39.95 or €39.95<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #CCFFCC" | proprietary<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
*{{note|EZCDAC|n}} EZ CD Audio Converter ignores C2 pointers in normal mode. In its two error detection modes, C2 pointers only are used to flag a track as having errors (possible errors, really, since the data may actually be correct). Although it is advertised as a "secure" ripper, as of late 2015 it only detects and warns of (possible) errors as indicated by CRC mismatch, C2 pointers, or sync errors; it does not try to get consistent results by re-reading.<br />
*{{note|EZCDAC|o}} In EZ CD Audio Converter, the drive's caching is disabled only when error detection mode #2 is used on a drive which reports that it does not support Accurate Stream.<br />
*{{note|XLDpe|p}} XLD detects pre-emphasis in the TOC since version 2009/11/8 and in subcode since version 2014/4/27.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers. A C2 pointer is a flag pointing to a particular byte in the audio data, indicating whether the drive suspects there was a read error which could not be corrected. This suspicion is based on the CD's built-in CIRC error detection and correction information.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, an error-indicating C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration. The lack of an error-indicating C2 pointer may be used by some rippers (such as EAC and XLD) as a reason to prevent re-reads.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
The CIRC system on audio CDs is not foolproof; a very tiny percentage of uncorrectable errors can fail to result in error-indicating C2 pointers, especially in error-heavy areas of a disc. Also, some drive firmware simply doesn't reliably report errors in the C2 pointers, for reasons unknown.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-07-10T01:32:32Z<p>Mjb: /* C2 pointers */ http://www.hydrogenaud.io/forums/index.php?s=&showtopic=109618&view=findpost&p=902826</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
|-<br />
!colspan="14" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
!colspan="14" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers. A C2 pointer is a flag pointing to a particular byte in the audio data, indicating whether the drive suspects there was a read error which could not be corrected. This suspicion is based on the CD's built-in CIRC error detection and correction information.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, an error-indicating C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration. The lack of an error-indicating C2 pointer may be used by some rippers (such as EAC and XLD) as a reason to prevent re-reads.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
The CIRC system on audio CDs is not foolproof; a very tiny percentage of uncorrectable errors can fail to result in error-indicating C2 pointers, especially in error-heavy areas of a disc. Also, some drive firmware simply doesn't reliably report errors in the C2 pointers, for reasons unknown.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-06-01T04:21:31Z<p>Mjb: /* C2 pointers */ Clarifications to address concern about the ambiguous use of "C2 pointers" to refer to either C2 pointers in general, or error-indicating C2 pointers in particular</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
|-<br />
!colspan="14" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
!colspan="14" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers. A C2 pointer is a flag pointing to a particular byte in the audio data, indicating whether the drive suspects there was a read error which could not be corrected. This suspicion is based on the CD's built-in CIRC error detection and correction information.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, an error-indicating C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration. The lack of an error-indicating C2 pointer may be used by some rippers (such as EAC) as a reason to prevent re-reads.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
The CIRC system on audio CDs is not foolproof; a very tiny percentage of uncorrectable errors can fail to result in error-indicating C2 pointers, especially in error-heavy areas of a disc. Also, some drive firmware simply doesn't reliably report errors in the C2 pointers, for reasons unknown.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-05-27T08:36:55Z<p>Mjb: /* C2 pointers */ continuation of previous edit, to explain EAC quirks</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
|-<br />
!colspan="14" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
!colspan="14" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers, which are info the drive provides about read errors that the drive detected but wasn't able to correct on its own.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, a C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration. The lack of a C2 pointer may be used by some rippers (such as EAC) as a reason to prevent re-reads.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
The CIRC system on audio CDs is not foolproof; a very tiny percentage of uncorrectable errors can fail to result in C2 pointers, especially in error-heavy areas of a disc. Also, some drive firmware simply doesn't reliably report C2 pointers, for reasons unknown.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2015-05-27T07:43:14Z<p>Mjb: /* Comparison chart */ Since we describe C2 pointers as being used for forcing re-reads, we need to clarify that EAC is different in that it uses (lack of) C2 pointers for disabling re-reads</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
|-<br />
!colspan="14" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | [[pre-emphasis]] detection<br />
| style="background: #00FF00" | yes (TOC only)<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (which?)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes (TOC+subcode)<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass{{ref|eacC2|m}}<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
!colspan="14" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
*{{note|eacC2|m}} In EAC, C2 pointers are only considered if the Secure Mode option "Drive is capable of retrieving C2 error information" is checked. When checked, the lack of a pointer will prevent re-reads, thereby speeding up the rip, but possibly allowing errors to slip through, because at that point it is essentially the same as burst mode.<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Pre-emphasis detection===<br />
A small minority of audio CDs are authored with [[pre-emphasis]]. This means a high frequency boost was applied to the audio during the original digital recording. A corresponding high frequency cut must be applied for the audio to sound as originally intended. If a CD with pre-emphasis is played without this corresponding de-emphasis, the audio will have more high frequency content than intended, and will often sound like it is being replayed with the treble/tone control turned up.<br />
<br />
Flags to tell a CD player to apply de-emphasis can be stored in a CD's subcode, the TOC, or ideally both. There are several CDs with pre-emphasis which only include the flag in the subcode, and not the TOC. A conventional hardware CD player will enable its de-emphasis circuit based on the subcode, not the TOC. Some CD rippers detect pre-emphasis based on the TOC, not the subcode. Where known, this is noted in the above table.<br />
<br />
When detected by the ripper, the presence of pre-emphasis may be noted in the CUEsheet (if generated) or a tag. Alternatively the ripper may be configured to process the audio by applying a digital de-emphasis filter, thus generating audio without pre-emphasis that does not need to be tagged or flagged.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers, which are info the drive provides about read errors that the drive detected but wasn't able to correct on its own.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, a C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Cue_sheetCue sheet2015-04-05T14:08:06Z<p>Mjb: misc edits for accuracy and detail</p>
<hr />
<div><!--<br />
TODO:<br />
<br />
Mention of HTOA with link to new page...although there is already an HTOA example.<br />
Example of the first few lines, showing INDEX 00<br />
<br />
PERFORMER "Lemon Jelly"<br />
TITLE "'64 - '95"<br />
FILE "CDImage.ape" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Intro"<br />
PERFORMER "Lemon Jelly"<br />
INDEX 00 00:00:00<br />
INDEX 01 01:23:18<br />
TRACK 02 AUDIO<br />
TITLE "'88 AKA Come Down On Me"<br />
PERFORMER "Lemon Jelly"<br />
INDEX 01 01:47:53<br />
<br />
Examination of a segment or segements of a cue sheet, focusing on the key commands<br />
<br />
Embedding cue sheets - may require its own page<br />
<br />
--><br />
<br />
A '''cue sheet''' (or '''CUE file''', '''.cue''', '''CUE sheet''', etc.) is a formatted text file which provides index and other supplemental information for one or more audio files. A cue sheet is generally used in conjunction with either extracting from or burning to [[Compact Disc|CD]]. For example, when a CD's complete audio content has been ripped to a single file, a cue sheet contains information about the track boundaries, and CD-R burning software can use it to make a copy of the original CD with the same track layout as the original. Cue sheets can also be used when writing data CDs.<br />
<br />
Increasingly, cue sheets are being used as playlists: you load the cue sheet in a media player, and it can play an "image" (single-file) rip as if it were separate files, one for each track. Cue sheets can be used for file-per-track rips as well, but many such rips require that the cue sheet not adhere strictly to the original specification's rules.<br />
<br />
==Cue sheet contents==<br />
All cue sheets contain the following info:<br />
* The name & type of at least one file being indexed (an audio file, normally);<br />
* A numbered list of tracks each file corresponds to or contains;<br />
* The start point (index 01) for each track, time-wise (MM:SS:FF format).<br />
<br />
Cue sheets may contain the following additional info:<br />
* CD-Text [[metadata]] such as performer, title, songwriter for the disc and/or each track;<br />
* ISRCs (sound recording IDs to burn)<br />
* Special flags for CD burning (e.g. for pre-emphasis)<br />
* Gap info (how much silence to insert before or after each track)<br />
* Comments (which are used by some programs to store nonstandard metadata like genre, freeDB disc ID, etc.)<br />
<br />
A cue sheet isn't necessary to make an exact copy of the audio portion of a CD; ripping & burning software will get you the audio wave data and can figure out where each track starts. However, a cue sheet ''can'' be used to specify the location of the first track (if it deviates from the standard), as well as certain subcode information, such as non-01 index points, CD-TEXT (which may not exist on the original CD), UPC/ISRC data, and [[pre-emphasis]] information.<br />
<br />
A cue sheet ''is'' required to burn "hidden track one audio" ([[HTOA]]), which is audio that can only be played after scanning backwards from the beginning of track 1. A cue sheet may be needed when silent frames have been omitted from the beginning or end of files to be burned; the cue sheet can be used to reconstruct the pauses by telling the burner or player where to insert silence. A cue sheet may also be needed when there is a mix of audio and data tracks to be burned (unless the burning software is told which tracks are which).<br />
<br />
== History ==<br />
The cue sheet format was invented by Jeff Arnold of [http://www.goldenhawk.com/ GoldenHawk Technology] for use with his [[DAO]] ('''D'''isc '''A'''t '''O'''nce) and [http://www.goldenhawk.com/ CDRWIN] applications. The format has since been adopted as the ''de facto'' standard, and is used by various other applications, including the audio player [[foobar2000]]. The official cue sheet specification is widely accepted to be Appendix A of the CDRWIN User's Guide.<br />
<br />
The name is taken from the '''SEND CUE SHEET''' command (as defined in the ''SCSI-3 Multimedia Commands'' specification), used for sending a binary-format cue sheet describing the disc layout to the drive before writing starts in SAO (Session-At-Once) write mode. The drive writes to the disc, using the cue sheet information to generate the P and Q subchannel data, and to retrieve the format and block size of the data transferred with the '''WRITE''' command.<ref>Text adapted from [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=42485&view=findpost&p=374579 a post by Martin H].</ref><br />
<br />
The DAO and CDRWIN software was developed for use on MS-DOS and early Windows systems, when it was common to refer to types of files by their file name extensions, in all-caps: TXT for text, DOC for Word document, and so on. Early references to cue sheets likewise referred to ''CUE files''. This convention continues to the present day, but the ''cue'' in the term ''cue sheet'' is not an acronym and need not be capitalized.<br />
<br />
== Cue sheet commands ==<br />
The following commands are detailed in the Appendix A of the [http://www.goldenhawk.com/ CDRWIN] User's Guide:<br />
* CATALOG – A 13-digit UPC/EAN code.<br />
* CDTEXTFILE – A path to a file containing CD-Text info.<br />
* FILE – A path to a file containing audio data, and to which subsequent commands apply.<br />
* FLAGS – Per-track subcode flag(s). <br />
* INDEX – Per-track index(es).<br />
* ISRC – Per-track ISRC(s).<br />
* PERFORMER – Per-disc or per-track performer name for CD-Text data.<br />
* POSTGAP – Amount of post-track silence to add.<br />
* PREGAP – Amount of pre-track silence to add.<br />
* REM – A remark/comment to be ignored.<br />
* SONGWRITER – Per-disc or per-track songwriter name for CD-Text data.<br />
* TITLE – Per-disc or per-track title for CD-Text data.<br />
* TRACK – Type of track to create, and to which subsequent commands apply.<br />
<br />
=== Most often used ===<br />
;FILE<br />
:The FILE command specifies the file that the cue sheet is currently referencing. Valid file types are WAVE, MP3, AIFF, BINARY and MOTOROLA. Other formats, such as the lossless formats [[WavPack]] or [[FLAC]], can also be used under the WAVE file type.<br />
;INDEX<br />
:A number between 00 and 99. Index points are specified in MM:SS:FF format, and are relative to the start of the file currently referenced. MM is the number of minutes, SS the number of seconds, and FF the number of frames (there are seventy five frames to one second). INDEX 01 commands specify the beginning of a new track. INDEX 00 commands specify the pre-gap of a track; you may notice your [[Compact Disc Digital Audio|Audio CD]] player count up from a negative value before beginning a new track - this is the period between INDEX 00 and INDEX 01.<br />
;PERFORMER<br />
:At top-level this will specify the CD artist, while at track-level it specifies the track artist.<br />
;PREGAP<br />
:Used to specify the length of a track pre-gap, in MM:SS:FF format. Although the SCSI specs reserve the term ''pre-gap'' for the pause before a data track, in a cue sheet the PREGAP command can be used to create a pause before any kind of track, data or audio.<br />
;REM<br />
:Used to record comments in a cue sheet. This command is often used to store additional meta data to TITLE and PERFORMER, e.g.: the date or genre of the disc.<br />
;TITLE<br />
:At top-level this will specify the album name, while at track-level it specifies the track name.<br />
;TRACK<br />
:A number between 01 and 99, indicating the track number.<br />
<br />
=== Whitespace ===<br />
Line breaks must be used between commands. Spaces or tabs can be used to indent; they're ignored but can make the file easier to understand when viewing or manually editing. Customarily, for audio CDs, all the commands which apply to a particular file are indented under the FILE command, and those which apply to a specific track are further indented under the TRACK command.<br />
<br />
=== Examples ===<br />
'''A standard single file cue sheet'''<br />
<pre><br />
REM GENRE Alternative<br />
REM DATE 1991<br />
REM DISCID 860B640B<br />
REM COMMENT "ExactAudioCopy v0.95b4"<br />
PERFORMER "My Bloody Valentine"<br />
TITLE "Loveless"<br />
FILE "My Bloody Valentine - Loveless.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Only Shallow"<br />
PERFORMER "My Bloody Valentine"<br />
INDEX 01 00:00:00<br />
TRACK 02 AUDIO<br />
TITLE "Loomer"<br />
PERFORMER "My Bloody Valentine"<br />
INDEX 01 04:17:52<br />
</pre><br />
The cue sheet above, created by [[EAC]], shows the first two tracks of a standard single file cue sheet. Note the use of REM commands to record additional [[metadata]], in the format '''REM <TAG> "<value>"'''. The '''PERFORMER''' and '''TITLE''' commands at the top of the cue sheet detail the [[Compact Disc Digital Audio|CD]] artist and album name respectively. The '''PERFORMER''' and '''TITLE''' commands at track-level specify the track artist and title.<br />
<br />
TRACK 02's INDEX 01 entry does not state that the track is 4m 17.693s long, but that the beginning of the track is 4m 17.693s into the file (so TRACK 01 was in fact 4m 17.693s long). If TRACK 02 was 3m long exactly, TRACK 03's INDEX 01 value would be 07:17:52.<br />
<br />
Also note the file reference specifying a relative path to the file (references can also be absolute) and the file type: [[WAV|WAVE]].<br />
<br />
==== A single-file cue sheet with a TRACK 01 INDEX 00 hidden track ====<br />
<pre><br />
PERFORMER "Bloc Party"<br />
TITLE "Silent Alarm"<br />
FILE "Bloc Party - Silent Alarm.flac" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Like Eating Glass"<br />
PERFORMER "Bloc Party"<br />
INDEX 00 00:00:00<br />
INDEX 01 03:22:70<br />
TRACK 02 AUDIO<br />
TITLE "Helicopter"<br />
PERFORMER "Bloc Party"<br />
INDEX 00 07:42:69<br />
INDEX 01 07:44:69<br />
</pre><br />
<!--clarify that this is HTOA--><br />
The cue sheet above shows the first two tracks of a single file cue sheet for a disc with a hidden track at the start. Note that TRACK 01 INDEX 01 starts at 03:22:70 (3m 22.933s) instead of 00:00:00 as in the first example, and most cue sheets. The INDEX 00 index on TRACK 02 displays the more usual behaviour, being two seconds before INDEX 01.<br />
<br />
As the INDEX 00 is on TRACK 01 you will not normally see the usual countdown from a negative value that you might see from an INDEX 00 command on a subsequent track. To listen to this track on a [[Compact Disc Digital Audio|Audio CD]] player you will need to start the disc playing and press rewind, to rewind, essentially, from 3m 22s into the disc back to the true beginning.<br />
<br />
Also note that the file referenced is [[FLAC]], but the [[WAV|WAVE]] files type is used. For [[MP3]] files the file type "'''[[MP3]]'''" should be used, for [[AIFF]] you should use "'''[[AIFF]]'''", but for all other types "'''[[WAV|WAVE]]'''" is used.<br />
<br />
==== Multiple files with corrected gaps ====<br />
<pre><br />
FILE "The Specials - Singles - 01 - Gangsters.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Gangsters"<br />
PERFORMER "The Specials"<br />
INDEX 01 00:00:00<br />
FILE "The Specials - Singles - 02 - Rudi, A Message To You.wav" WAVE<br />
TRACK 02 AUDIO<br />
TITLE "Rudi, A Message To You"<br />
PERFORMER "The Specials"<br />
INDEX 00 00:00:00<br />
INDEX 01 00:00:28<br />
</pre><br />
This mutiple file cue sheet, created by [[EAC]], has gaps prepended to the next track. This method allows users to retain gaps, but by prepending the gap to the next track each track may begin with silence, which makes playback less satisfactory. This is a very uncommon way to rip CDs, even though it is more in line with the disc's actual track layout.<br />
<br />
==== Multiple files with gaps left out ====<br />
<pre><br />
FILE "The Specials - Singles - 01 - Gangsters.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Gangsters"<br />
PERFORMER "The Specials"<br />
INDEX 01 00:00:00<br />
FILE "The Specials - Singles - 02 - Rudi, A Message To You.wav" WAVE<br />
TRACK 02 AUDIO<br />
TITLE "Rudi, A Message To You"<br />
PERFORMER "The Specials"<br />
PREGAP 00:00:28<br />
INDEX 01 00:00:00<br />
</pre><br />
This mutiple file cue sheet, created by [[EAC]], has removed the gaps, but artificially recreates silence between tracks using the PREGAP command. This is fine if the gap was silence, but unsatisfactory if it contained audio.<br />
<br />
==== Multiple files with gaps (Noncompliant) ====<br />
<pre><br />
FILE "The Specials - Singles - 01 - Gangsters.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Gangsters"<br />
PERFORMER "The Specials"<br />
INDEX 01 00:00:00<br />
TRACK 02 AUDIO<br />
TITLE "Rudi, A Message To You"<br />
PERFORMER "The Specials"<br />
INDEX 00 02:47:74<br />
FILE "The Specials - Singles - 02 - Rudi, A Message To You.wav" WAVE<br />
INDEX 01 00:00:00<br />
</pre><br />
This multiple-file cue sheet, created by [[EAC]], has gaps appended to the previous track, and is a favourite among users who rip to track files but wish to retain gap information. This format allows the user to retain gaps, but in a position in the track file that does not hinder playback. Unfortunately, this format is non-compliant; this type of rip, despite its popularity, was not supported by the original DAO and CDRWIN software for which cue sheets were designed. Applications that adhere to the cue sheet specification, like [[foobar2000]], will not be able to read it. Of course, [[EAC]] will read these cue sheets, as will the [[Compact Disc|CD]] burning application [[Burrrn]].<br />
<br />
Note that INDEX 00 of TRACK 02 is set while still referencing the first FILE.<br />
<br />
==== Single file version of the cue sheet used above ====<br />
<pre><br />
FILE "The Specials - Singles.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Gangsters"<br />
PERFORMER "The Specials"<br />
INDEX 01 00:00:00<br />
TRACK 02 AUDIO<br />
TITLE "Rudi, A Message To You"<br />
PERFORMER "The Specials"<br />
INDEX 00 02:47:74<br />
INDEX 01 02:48:27<br />
</pre><br />
For reference, the cue sheet used in the examples above is in single file format.<br />
<br />
== Example cue sheet ==<br />
<pre><br />
REM GENRE Ska<br />
REM DATE 1991<br />
REM DISCID D00DA810<br />
REM COMMENT "ExactAudioCopy v0.95b4"<br />
PERFORMER "The Specials"<br />
TITLE "Singles"<br />
FILE "The Specials - Singles.wav" WAVE<br />
TRACK 01 AUDIO<br />
TITLE "Gangsters"<br />
PERFORMER "The Specials"<br />
INDEX 01 00:00:00<br />
TRACK 02 AUDIO<br />
TITLE "Rudi, A Message To You"<br />
PERFORMER "The Specials"<br />
INDEX 00 02:47:74<br />
INDEX 01 02:48:27<br />
TRACK 03 AUDIO<br />
TITLE "Nite Klub"<br />
PERFORMER "The Specials"<br />
INDEX 00 05:41:50<br />
INDEX 01 05:42:27<br />
TRACK 04 AUDIO<br />
TITLE "Too Much Too Young"<br />
PERFORMER "The Specials"<br />
INDEX 00 08:53:47<br />
INDEX 01 08:54:37<br />
TRACK 05 AUDIO<br />
TITLE "Guns Of Navarone"<br />
PERFORMER "The Specials"<br />
INDEX 00 10:59:20<br />
INDEX 01 11:00:17<br />
TRACK 06 AUDIO<br />
TITLE "Rat Race"<br />
PERFORMER "The Specials"<br />
INDEX 00 13:20:55<br />
INDEX 01 13:20:67<br />
TRACK 07 AUDIO<br />
TITLE "Stereotype"<br />
PERFORMER "The Specials"<br />
INDEX 00 16:29:67<br />
INDEX 01 16:30:30<br />
TRACK 08 AUDIO<br />
TITLE "International Jet Set"<br />
PERFORMER "The Specials"<br />
INDEX 00 20:19:27<br />
INDEX 01 20:20:20<br />
TRACK 09 AUDIO<br />
TITLE "Do Nothing"<br />
PERFORMER "The Specials"<br />
INDEX 00 24:30:70<br />
INDEX 01 24:32:27<br />
TRACK 10 AUDIO<br />
TITLE "Ghost Town"<br />
PERFORMER "The Specials"<br />
INDEX 00 28:23:30<br />
INDEX 01 28:23:42<br />
TRACK 11 AUDIO<br />
TITLE "Why?"<br />
PERFORMER "The Specials"<br />
INDEX 00 34:21:37<br />
INDEX 01 34:21:47<br />
TRACK 12 AUDIO<br />
TITLE "Friday Night, Saturday Morning"<br />
PERFORMER "The Specials"<br />
INDEX 00 38:16:50<br />
INDEX 01 38:16:55<br />
TRACK 13 AUDIO<br />
TITLE "War Crimes"<br />
PERFORMER "The Specials"<br />
INDEX 00 41:50:07<br />
INDEX 01 41:51:00<br />
TRACK 14 AUDIO<br />
TITLE "Racist Friend"<br />
PERFORMER "The Specials"<br />
INDEX 00 45:50:55<br />
INDEX 01 45:51:72<br />
TRACK 15 AUDIO<br />
TITLE "Nelson Mandela"<br />
PERFORMER "The Specials"<br />
INDEX 00 49:35:55<br />
INDEX 01 49:38:22<br />
TRACK 16 AUDIO<br />
TITLE "(What I Like Most About You Is Your) Girlfriend"<br />
PERFORMER "The Specials"<br />
INDEX 00 54:11:00<br />
INDEX 01 54:12:40<br />
</pre><br />
<br />
== Useful applications ==<br />
=== Playing ===<br />
* [[foobar2000]]<br />
<br />
=== Splitting ===<br />
* [[ACDIR]]: http://nyaochi.sakura.ne.jp/xoops/modules/mysoftwares/tc_2.html<br />
* CUE Splitter: http://www.enfis.it/downloads.php?cat_id=1<br />
* CueProc: http://nyaochi.sakura.ne.jp/xoops/modules/mysoftwares/tc_6.html<br />
* [[CueTools]]: http://www.hydrogenaudio.org/forums/index.php?showtopic=41476<br />
* [[foobar2000]]: http://www.foobar2000.org/<br />
* pcutmp3: http://www.hydrogenaudio.org/forums/index.php?showtopic=35654<br />
* [[shntool]]: http://www.etree.org/shnutils/shntool/<br />
* WavSplit: http://tangerine.uw.hu/prog/<br />
<br />
=== Joining ===<br />
* CueMake: http://www.synthetic-soul.co.uk/files/cuemake/<br />
* [[CueTools]]: http://www.hydrogenaudio.org/forums/index.php?showtopic=41476<br />
* [[foobar2000]]: http://www.foobar2000.org/<br />
* [[shntool]]: http://www.etree.org/shnutils/shntool/<br />
<br />
=== Creating ===<br />
* CD Wave: http://www.milosoftware.com/cdwave/<br />
* CueMaster: http://cuemaster.org/<br />
* [[CueTools]]: http://www.hydrogenaudio.org/forums/index.php?showtopic=41476<br />
* [[foobar2000]]: http://www.foobar2000.org/<br />
* [[Goldwave]]: http://www.goldwave.com/<br />
* [[shntool]]: http://www.etree.org/shnutils/shntool/<br />
* Wave Repair: http://www.waverepair.com/<br />
<br />
== References ==<br />
<references/><br />
<br />
== See also ==<br />
* [[Gap settings]]<br />
* [[EAC CUE Sheets]]<br />
<br />
== External links ==<br />
* Wikipedia article: [[wikipedia:Cue sheet (computing)|Cue sheet (computing)]]<br />
* The Goldenhawk website: [http://goldenhawk.com/ goldenhawk.com]<br />
<br />
[[Category:CD ripping]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=EAC_Gap_SettingsEAC Gap Settings2015-03-19T05:17:27Z<p>Mjb: /* Reading gaps */ Some rephrasing and additional info so as not to make it sound like you're doing something wrong if you don't mess with gap detection. Also, added headings and moved index-based rip info to its own section</p>
<hr />
<div>'''This article is based on MestreLion's great research posted at [http://www.digital-inn.de/showthread.php?postid=54218 EAC forum], but has since been edited.'''<br />
<br />
<br />
The goal of this little tutorial is:<br />
<br />
* To save beginners a lot of time<br />
* To explain what a gap is what how the different gap menu options work in EAC<br />
* To explain what a CUE Sheet is<br />
* To explain why there are so many options for creating CUE Sheets, and how they relate to Gap settings<br />
<br />
Here's what this tutorial should help you achieve:<br />
<br />
* Extract a CD into several WAV files which you can compress, tag, and save.<br />
* Use those same WAV files to burn an exact copy of the original CD.<br />
<br />
<br />
==Standard handling of gaps==<br />
<br />
Lets imagine an hypothetical CD with this layout:<br />
<br />
Track 1<br />
- Index 01: 1 minute<br />
<br />
Track 2<br />
- Index 00: 2 secs<br />
- Index 01: 2 minutes<br />
<br />
Track 3<br />
- Index 00: 3 secs<br />
- Index 01: 3 minutes<br />
<br />
Track 4<br />
- Index 00: 4 secs<br />
- Index 01: 4 minutes<br />
<br />
<br />
The index 00 portions are the "gaps", sometimes called "pre-track gaps" or "pregaps". Typically they contain silence (or very quiet noise), and when played in a real CD player, the play position would count up from a negative time to zero, like -0:03, -0:02, -0:01, 0:00, with the song starting at 0:00, which is also where the player jumps to when you choose a specific track.<br />
<br />
If you don't do anything special when ripping tracks to separate files (i.e., you just do ''"Action -> Copy Selected Tracks -> Uncompressed (F5)"'' or ''"-> Compressed (Shift+F5)"''), then the gaps will be automatically appended to the end of the previous track in the WAV files. So your WAV files will be like this:<br />
<br />
Track1.wav : 1:02 (1st song + gap of the 2nd track)<br />
Track2.wav : 2:03 (2nd song + gap of the 3nd track)<br />
Track3.wav : 3:04 (3rd song + gap of the 4nd track)<br />
Track4.wav : 4:00 (4th song)<br />
<br />
That's how file-per-track rips are normally made by all rippers, because people typically want the audio at the beginning of each file to be the beginning of the song.<br />
<br />
==Alternatives==<br />
<br />
If you do ''"Action -> Detect Gaps (F4)"'' before extracting the WAVs, you can have more control over the gaps. Doing so, you have now 3 ways to handle gaps (the last 3 options in the Action menu):<br />
<br />
* '''Leave Out Gaps'''<br />
* '''Append Gaps to Previous Track'''<br />
* '''Append Gaps to Next Track'''<br />
<br />
These options, and more, are explained below.<br />
<br />
===Leave Out Gaps===<br />
<br />
This will simply ignore gap data (00 indexes). Only indexes 01 and over will be recorded to the WAVs. The WAV files will look like this:<br />
<br />
Track1.wav : 1:00 (1st song)<br />
Track2.wav : 2:00 (2nd song)<br />
Track3.wav : 3:00 (3rd song)<br />
Track4.wav : 4:00 (4th song)<br />
<br />
The big problem with this option is that the gap data from the CD is lost in this process. If your goal is an exact copy, this option is not a good idea. Also, removing the gap data can interfere with the use of [[AccurateRip]], preventing the rips of any gap-containing tracks from being checked against other people's for a match.<br />
<br />
However, leaving out gaps might be useful under some circumstances. The gap data lost may be only "useless" silence between tracks, and you might want to store only actual music content. Or perhaps you want to manually change the silent between tracks when writing the CD, so having "trimmed" WAVs can help controlling the silent spacing when writing the CD-R.<br />
<br />
But gaps are not only silence. This may be true for most albums, but not all. Remember that gaps can be silence, but also can be anything from audience clapping to actual music.<br />
<br />
You can test if the gaps are silent using "Action - Test Gaps On Silence". (Poor grammar there; it really should read "Action - Test Gaps '''For''' Silence). Unfortunately this function is not sensitive enough to distinguish low-level noise from digital silence (null samples, or samples with zero amplitude).<br />
<br />
For our example, we want our copy to be as exact as possible. So if the gaps are in the original, they must be in the copy just the way they are.<br />
<br />
===Append Gaps to Previous Track===<br />
<br />
This is the default action. It works the same way as if no gap detection is made, and was explained above.<br />
<br />
===Append Gaps to Next Track===<br />
<br />
This is similar to the default, but the gap is written in the beginning of the track, like this:<br />
<br />
Track1.wav : 1:00 (1st song)<br />
Track2.wav : 2:02 (pregap of the 2nd track + 2nd song)<br />
Track3.wav : 3:03 (pregap of the 3nd track + 3nd song)<br />
Track4.wav : 4:04 (pregap of the 4nd track + 4nd song)<br />
<br />
This might look the most "natural" way to store the gaps, but actually its very odd. Usually the gaps are silences, so it's a bit weird for a track to start with a silence, instead of ending with it.<br />
<br />
Also, when you use the seek button in any standalone player, for, say, Track 3, it will begin playing the Track 3 - index 01 (aka 3rd song), not it's 00 index! The only way for you to listen to the 3 secs pregap is to listen all the way from Track 2. The player will play Track 2 - index 01, then the pregap. When the pregap is playing, the player will display negative seconds: -0:03, -0:02, then -0:01).<br />
<br />
So, if the only way to listen this gap is by playing track 2 until the end, it makes sense to say that the 3s pregap actually belongs to the 2nd track, not the 3rd! (even if in the actual CD layout the 3s gap is called "track 3 - index 00").<br />
<br />
===Index-based rip===<br />
<br />
There's actually a fourth option for handling gaps, and it doesn't require gap detection first (it will happen automatically).<br />
<br />
For extraction, you could use ''Action -> Copy Selected Tracks Index-Based -> Uncompressed (Alt+X)"'' or ''"-> Compressed (Alt+Shift+X)"'' to cause the gaps to be written to disk as separate WAV files. For this to work, you'd need to make sure the ''%N'' (track number) is in the ''Naming scheme'' (under ''EAC Options (F9) -> Filename''). Except for grabbing a hidden track before the first track, extracting gaps (and other non-01 indices) to their own files isn't typically done, so the discussion here will only focus on the main options.<br />
<br />
==Choose wisely==<br />
<br />
So, bottom line for reading gaps: For things to go perfect, you don't even have to detect gaps! If you don't, EAC will automatically read them and store them in the end of the previous track. If you do, make sure that the default option is selected, or select something else being very sure of what you're doing.<br />
<br />
==Writing gaps==<br />
<br />
WAVs recorded, you're ready to burn the CD-R. If you just want the CD copy to sound the same as the original, just go to ''Tools -> Write CD-R -> Layout -> Append Files As New Tracks (Index 1)'', select all the WAVs, and be happy.<br />
<br />
As the gaps are recorded within the WAV files, the resulting cd will have the same "song, gap, song, gap" pattern. Also, gaps will behave like they ought to: if you seek to Track 3, it will jump directly to the 3rd song. To hear the gap before track 3, just listen track 2 until the end.<br />
<br />
But, if you look carefully, something is different: In the CD layout, there will be no Index 0 in any of the tracks. After all, all data on the gaps were appended to the songs (01 indexes).<br />
<br />
Should you care? Probably not. As far as I learned here, no software or hardware make any useful use of indexes. Most (if not all) PC Players just ignore this information. The only perceptible difference is the time count used in standalone players.<br />
<br />
In the original CD, the 1st track will play from 00:00 to 01:00, then a negative -00:02 countdown (count-up, technically) will be displayed while the gap (track 02, index 00) is being played, and finally track 2 will start at 00:00. In the CD-R copy, track 1 will be 01:02 long. Display will go from 00:00 to 01:00 and continue to 01:01, 01:02 as the 1st song and the subsequent gap is played, and then track 2 will start at 00:00.<br />
<br />
If you close your eyes and just listen, all will be the same. If you use seek and search buttons, all will be the same. Only the fancy -2s display countdown will now be displayed as part of the 1st track. That's it.<br />
<br />
But do you care for this fancy display effect? Do you want to keep the index marking for the sake of fidelity, even if this is completely useless? Then the job can easily be done using CUE Sheets.<br />
<br />
===CUE sheets===<br />
:''See also: [[EAC and Cue Sheets]]''<br />
<br />
A [[Cue sheet|CUE Sheet]] is a text file that defines a CD Layout. It tells the burner program what tracks and indexes the CD will have, its length, and how the source WAVs will be "sliced" in these tracks and indexes. The WAVs on disk won't be modified; it's just a guide for how the audio data in them will be burned onto the CD. So, before burning the blank CD, you must first Create a CUE Sheet based on the album you're reading and how you extracted the WAV files from it.<br />
<br />
EAC gives 4 options for creating this CUE Sheet, the only difference being the way each handles the gaps found in the original CD. The options, accessed through the ''"Action -> Create CUE Sheet"'', are:<br />
<br />
* '''Current Gap Settings''' [not available in Beginner mode]<br />
* '''Single WAV File'''<br />
* '''Multiple WAV Files With Gaps (Noncompliant)''' [shown as '''Multiple WAV Files''' in Beginner mode]<br />
* '''Multiple WAV Files With Left Out Gaps''' [not available in Beginner mode]<br />
* '''Multiple WAV Files With Corrected Gaps''' [not available in Beginner mode]<br />
<br />
'''Current Gap Settings''' creates a CUE Sheet based on the currently selected gap settings (the options to leave out or append gaps to the previous/next track). That is, it chooses one of the other options automatically. This will be what you want, unless you've forgotten or changed the gap settings from what they were at the time you extracted the tracks to WAVs, in which case you should select one of the other options manually.<br />
<br />
'''Single WAV File''' generates a CUE Sheet where a single .wav is sliced in all the tracks in indexes. So, as the name suggests, it is the default when you extracted the full album to a single .wav file (presumably using the ''Action -> Create Image option''). It creates both 01 and 00 indexes, thus preserving original CD layout and content.<br />
<br />
'''Multiple WAV Files With Left Out Gaps''' creates a CD Layout identical to the original assuming the tracks were ripped with gaps left out (hence the name). All the data stored in the tracks will only be recorded in the 01 indices; the 00 indices will be filled with null samples.<br />
<br />
Although it perfectly preserves the CD layout, the copy is only identical ''if the content of the gaps in the original CD is comprised only of null samples (samples with zero amplitude)''! In other words, all non-zero samples in the gaps are lost upon ripping and replaced with samples that are null upon burning. It is a common misconception that one can safely tell EAC to detect gaps for silence by selecting ''Action -> Test Gaps On Silence (F3)'' and verify that all the gaps contains 100.0% silence. Unfortunately EAC can still report 100.0% silence for gaps that contain samples that are not null; therefore, EAC's ''Test Gaps On Silence function'' is not to be trusted!<br />
<br />
'''Multiple WAV Files With Gaps (Noncompliant)''' slices the WAVs assuming that the gaps were appended to the end of each (previous) track. So, using our imaginary album, the first 2 minutes of Track2.wav would be recorded in Track 02 - Index 01, and the last 3 seconds would be Track 03 - Index 00.<br />
<br />
This is the option that should be used when the WAVs are extracted the default way. The scary "Noncompliant" term means that many other burners, like CDRWin, can't correctly recognize CUE Sheets where WAVs are sliced this way as valid CUE Sheets. So that's something you should care about if you only use EAC for extraction (thus for creating the CUE Sheets) and another external programs for burning. If you use EAC for extraction ''and'' burning, there's nothing to fear, as EAC can properly read its own generated CUE Sheet quite well.<br />
<br />
'''Multiple WAV Files With Corrected Gaps''' slices the WAVs assuming that the gaps were appended to the beginning of the next track. That is, this option should be used to correctly recreate the original CD layout and content when you used the "Append Gaps to Next Track" option when extracting the WAVs.<br />
<br />
So, create the CUE Sheet that best represent the gap format you used when extracted the WAVs. Now it's very easy to burn a CD-R. Just go to ''Tools -> Write CD-R -> File -> Load CUE Sheet''. Now see how the WAVs are properly sliced? (if not, you did something wrong.) Time to burn! Go to ''Cd-R -> Write CD'' and be happy!<br />
<br />
[[Category:EAC Guides]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2015-03-03T10:21:49Z<p>Mjb: /* $info(name) */ fmt</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in titleformatting functions and field references with special meaning. References to documentation about fields and function which can only be used in specific components or which are provided by specific components can be found at the end of this article.<br />
<br />
A field reference is a field name enclosed in percent signs, for example ''%artist%''. A function call starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty - denoted as ''()'' - or contain one or more parameters separated by commata, for example ''$abbr(%artist%)''. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of titleformat syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see: [[Foobar2000:Query_syntax|Query Syntax]].<br />
<br />
= Field remappings =<br />
<br />
Some of the fields accessible through ''%name%'' are remapped to other values to make writing titleformat scripts more convenient.<br />
<br />
== Metadata ==<br />
<br />
=== %album artist% ===<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
=== %album% ===<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
=== %artist% ===<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
=== %discnumber% ===<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
=== %track artist% ===<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
=== %title% ===<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
=== %tracknumber% ===<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
=== %track number% ===<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
== Technical information ==<br />
<br />
=== %bitrate% ===<br />
Bitrate of the track; includes dynamic VBR bitrate display for currently played track.<br />
<br />
=== %channels% ===<br />
Number of channels in the track (mono/stereo/etc). Returns the number of channels in text form; returns "mono" and "stereo" instead of "1" and "2".<br />
<br />
=== %filesize% ===<br />
Defined as ''%_filesize%''. Returns the filesize in bytes.<br />
<br />
=== %filesize_natural% ===<br />
Size of the file, automatically formatted in appropriate units such as megabytes or kilobytes. <br />
<br />
=== %samplerate% ===<br />
Sample rate of the track, in Hz.<br />
<br />
=== %codec% ===<br />
Name of codec used to encode the track. If exact codec name is not available, file extension is used.<br />
<br />
== Special fields ==<br />
<br />
= Control flow =<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
= Arithmetic functions =<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* "c3po" → 0<br />
* "4.8" → 4<br />
* "-12" → -12<br />
* "- 12" → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
= Boolean functions =<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
= Color functions =<br />
<br />
==For the Default User Interface==<br />
Starting in version 1.0, the Default UI playlist view doesn't support color functions. In that location, text color can only be adjusted via angle-bracket syntax: Use < and > characters to make specific text <dimmed> ''vs.'' the default color or >highlight>ed with the highlight color, with up to three levels in each case, ''e.g.'': <dimmed>, >highlight<, >>more highlight<<, <<<very dim>>>.<br />
<br />
==For Columns UI==<br />
<br />
The playlist in the Columns UI still supports the following functions:<br />
<br />
=== $blend(color1,color2,part,total) ===<br />
<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
=== $hsl() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $hsl(h,s,l) ===<br />
<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
=== $hsl(h1,s1,l1,h2,s2,l2) ===<br />
<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
=== $rgb() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $rgb(r,g,b) ===<br />
<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
=== $rgb(r1,g1,b1,r2,g2,b2) ===<br />
<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
=== $transition(string,color1,color2) ===<br />
<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
= Now playing info =<br />
The following functions and fields are usable for scripts used with the currently playing item, for example the status bar, the main window title and the copy command script. Please note that these special fields will ''not'' work in custom columns.<br />
<br />
== Special fields ==<br />
<br />
=== %playback_time% ===<br />
Returns the elapsed time formatted as [HH:]MM:SS.<br />
<br />
=== %playback_time_seconds% ===<br />
Returns elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
=== %playback_time_remaining% ===<br />
Returns remaining time until track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
=== %playback_time_remaining_seconds% ===<br />
Returns remaining time in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== %length% ===<br />
Returns the length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
=== %length_ex% ===<br />
Returns the length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
=== %length_seconds% ===<br />
Returns the length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
=== %length_seconds_fp% ===<br />
Returns the length of the track in seconds as floating point number.<br />
<br />
=== %length_samples% ===<br />
Returns the length of the track in samples.<br />
<br />
= Playlist info =<br />
The following functions and fields are usable for playlist display formatting (eg. per-column title formatting patterns).<br />
<br />
== Special fields ==<br />
<br />
=== %isplaying% ===<br />
<br />
Returns "1" if file is currently playing and empty string otherwise.<br />
<br />
=== %ispaused% ===<br />
<br />
Returns "1" if playback is paused, empty string otherwise.<br />
<br />
=== %list_index% ===<br />
<br />
Returns a zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
=== %list_total% ===<br />
<br />
Returns number of items in the playlist.<br />
<br />
=== %queue_index% ===<br />
<br />
Index of the specified item in the playback queue; available in playlist only. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
=== %queue_indexes% ===<br />
<br />
List of indexes of the specified item in the playback queue; available in playlist only. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
=== %queue_total% ===<br />
<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
= String functions =<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* $cut('abc123',3) → abc<br />
* $cut('abc123',0) → (nothing)<br />
* $cut('abc123',-1) → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* $left('abc123',3) → abc<br />
* $left('abc123',0) → (nothing)<br />
* $left('abc123',-1) → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* $num(123,5) → 00123<br />
* $num(-123,5) → -0123<br />
* $num(4.8,5) → 00004<br />
* $num(A1,5) → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest ===<br />
<br />
Returns the shortest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
= Track info =<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
== Metadata ==<br />
<br />
=== $meta(name) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
=== $meta(name,n) ===<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
=== $meta_sep(name,sep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
=== $meta_sep(name,sep,lastsep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
=== $meta_test(...) === <br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
=== $meta_num(name) ===<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
== Technical information ==<br />
<br />
=== $info(name) ===<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
<br />
<div style="font-size: 90%"><nowiki>*</nowiki> ''MP3_ACCURATE_LENGTH won't exist if gapless playback info isn't present or the file is not an MP3. The info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Gapless playback info is taken into account in .m4a files, but there's no special field to say so.''</div><br />
<br />
=== $channels() === <br />
Returns number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
=== %replaygain_album_gain% ===<br />
<br />
Returns ReplayGain album gain value.<br />
<br />
=== %replaygain_album_peak% ===<br />
<br />
Returns ReplayGain album peak value.<br />
<br />
=== %replaygain_track_gain% ===<br />
<br />
Returns ReplayGain track gain value.<br />
<br />
=== %replaygain_track_peak% ===<br />
<br />
Returns ReplayGain track peak value.<br />
<br />
== Special fields ==<br />
<br />
==== %filename% ====<br />
<br />
Returns the filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
<br />
Returns the filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
<br />
Returns the name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
<br />
Returns the date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
<br />
Returns the path.<br />
<br />
==== %_path_raw% ====<br />
<br />
Returns the path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
<br />
Returns the subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
Returns a string representing the version of foobar2000.<br />
<br />
= Time/Date Functions =<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
= Variable operations =<br />
<br />
Variables can be used to store strings and number. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
=== $get(name) ===<br />
<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined<br />
<br />
=== $put(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered<br />
<br />
=== $puts(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns nothing<br />
<br />
= Component-provided fields and functions on tracks =<br />
<br />
This section lists components that provide additional fields and functions that are useable in the context of any track.<br />
<br />
== Playback statistics ==<br />
<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
= Component-specific fields and functions =<br />
<br />
This section lists components that provide additional fields and functions that are only usable in the context of the particular component.<br />
<br />
== Album list ==<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
== Playlist Organizer ==<br />
* [http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Playlist_Organizer_(foo_plorg)#Nodes Playlist Organizer: Nodes Title Formatting]<br />
<br />
== Columns UI ==<br />
<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
= Additional Reading =<br />
<br />
* [[Foobar2000:Titleformat_Introduction|Introduction to titleformat scripts]]<br />
* '''titleformat_help.html''' in your Foobar2000 directory (ie C:\Program Files\foobar2000\titleformat_help.html) file:///C:/Program%20Files/foobar2000/titleformat_help.html<br />
<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_ReferenceFoobar2000:Title Formatting Reference2015-03-03T10:18:57Z<p>Mjb: /* $info(name) */ MP3_ACCURATE_LENGTH better description</p>
<hr />
<div>{{fb2k}}<br />
This article contains information about built-in titleformatting functions and field references with special meaning. References to documentation about fields and function which can only be used in specific components or which are provided by specific components can be found at the end of this article.<br />
<br />
A field reference is a field name enclosed in percent signs, for example ''%artist%''. A function call starts with a dollar sign, followed by the function name and the parameter list. A parameter list can either be empty - denoted as ''()'' - or contain one or more parameters separated by commata, for example ''$abbr(%artist%)''. Note that there must be no whitespace between the dollar sign and the function name, or the function name and the opening parenthesis of the parameter list.<br />
<br />
Please see [[Foobar2000:Title Formatting Introduction|Title Formatting Introduction]] for a general overview of titleformat syntax and its basic rules. The article [[foobar2000:Titleformat Examples|Titleformat Examples]] offers user-submitted examples of code for specific purposes; feel free to add your own if you think it can be of use to others.<br />
<br />
For details of the query syntax, which uses some of these fields to find files for playlists, etc., see: [[Foobar2000:Query_syntax|Query Syntax]].<br />
<br />
= Field remappings =<br />
<br />
Some of the fields accessible through ''%name%'' are remapped to other values to make writing titleformat scripts more convenient.<br />
<br />
== Metadata ==<br />
<br />
=== %album artist% ===<br />
Name of the artist of the album specified track belongs to. Checks following metadata fields, in this order: "album artist", "artist", "composer", "performer". The difference between this and ''%artist%'' is that ''%album artist%'' is intended for use where consistent value across entire album is needed even when per-track artists values vary.<br />
<br />
=== %album% ===<br />
Name of the album specified track belongs to. Checks following metadata fields, in this order: "album", "venue".<br />
<br />
=== %artist% ===<br />
Name of the artist of the track. Checks following metadata fields, in this order: "artist", "album artist", "composer", "performer". For a SHOUTcast stream which contains metadata, it is the StreamTitle up to the first "-" character.<br />
<br />
=== %discnumber% ===<br />
Index of disc specified track belongs to, within the album. Available only when "discnumber"/"disc" field is present in track’s metadata.<br />
<br />
=== %track artist% ===<br />
Name of the artist of the track; present only if ''%album artist%'' is different than ''%artist%'' for specific track. Intended for use together with ''%album artist%'', to indicate track-specific artist info, e.g. "%album artist% - %title%[ '//' %track artist%]". In this case, the last part will be displayed only when track-specific artist info is present.<br />
<br />
=== %title% ===<br />
Title of the track. If "title" metadata field is missing, file name is used instead. For a SHOUTcast stream which contains metadata, it is the StreamTitle after the first "-" character.<br />
<br />
=== %tracknumber% ===<br />
Two-digit index of specified track within the album. Available only when "tracknumber" field is present in track’s metadata. An extra '0' is placed in front of single digit track numbers (5 becomes 05).<br />
<br />
=== %track number% ===<br />
Similar to %tracknumber%, however single digit track numbers are not reformatted to have an extra 0.<br />
<br />
== Technical information ==<br />
<br />
=== %bitrate% ===<br />
Bitrate of the track; includes dynamic VBR bitrate display for currently played track.<br />
<br />
=== %channels% ===<br />
Number of channels in the track (mono/stereo/etc). Returns the number of channels in text form; returns "mono" and "stereo" instead of "1" and "2".<br />
<br />
=== %filesize% ===<br />
Defined as ''%_filesize%''. Returns the filesize in bytes.<br />
<br />
=== %filesize_natural% ===<br />
Size of the file, automatically formatted in appropriate units such as megabytes or kilobytes. <br />
<br />
=== %samplerate% ===<br />
Sample rate of the track, in Hz.<br />
<br />
=== %codec% ===<br />
Name of codec used to encode the track. If exact codec name is not available, file extension is used.<br />
<br />
== Special fields ==<br />
<br />
= Control flow =<br />
<br />
The functions in this section can be used to conditionally execute statements.<br />
<br />
=== [...] (conditional section) ===<br />
<br />
Evaluates the expression between ''['' and '']''. If it has the truth value ''true'', its string value and the truth value ''true'' are returned. Otherwise an empty string and ''false'' are returned.<br />
<br />
Example: ''[%artist%]'' returns the value of the artist tag, if it exists. Otherwise it returns nothing, when ''artist'' would return "?".<br />
<br />
=== $if(cond,then) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, ''false'' is returned.<br />
<br />
=== $if(cond,then,else) ===<br />
<br />
If ''cond'' evaluates to ''true'', the ''then'' part is evaluated and its value returned. Otherwise, the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if2(a,else) ===<br />
<br />
Like ''$if(a,a,else)'' except that ''a'' is only evaluated once. In other words, if ''a'' is true, ''a'' is returned, otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $if3(a1,a2,...,aN,else) ===<br />
<br />
Evaluates arguments ''a1'' ... ''aN'', until one is found that evaluates to ''true''. If that happens, its value is returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifequal(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is equal to ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $ifgreater(n1,n2,then,else) ===<br />
<br />
Compares the integer numbers ''n1'' and ''n2'', if ''n1'' is greater than ''n2'', the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $iflonger(s,n,then,else) ===<br />
<br />
Compares the length of the string ''s'' to the number ''n'', if ''s'' is longer than ''n'' characters, the ''then'' part is evaluated and its value returned. Otherwise the ''else'' part is evaluated and its value returned.<br />
<br />
=== $select(n,a1,...,aN) ===<br />
<br />
If the value of ''n'' is between 1 and N, ''an'' is evaluated and its value returned. Otherwise ''false'' is returned.<br />
<br />
= Arithmetic functions =<br />
<br />
The functions in this section can be used to perform arithmetic on integer numbers. A string will be automatically converted to a number and vice versa. The conversion to a number uses the longest prefix of the string that can be interpreted as number. Leading whitespace is ignored. Decimal points are not supported. Examples:<br />
* "c3po" → 0<br />
* "4.8" → 4<br />
* "-12" → -12<br />
* "- 12" → 0<br />
<br />
=== $add(a,b) ===<br />
<br />
Adds ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$add(a,b,...)'' is the same as ''$add($add(a,b),...)''.<br />
<br />
=== $div(a,b) ===<br />
<br />
Divides ''a'' by ''b'' and rounds down to an integer. If ''b'' evaluates to zero, it returns ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$div(a,b,...)'' is the same as ''$div($div(a,b),...)''.<br />
<br />
=== $greater(a,b) ===<br />
<br />
Returns true, if ''a'' is greater than ''b'', otherwise false.<br />
<br />
=== $max(a,b) ===<br />
<br />
Returns the maximum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$max(a,b,...)'' is the same as ''$max($max(a,b),...)''.<br />
<br />
=== $min(a,b) ===<br />
<br />
Returns the minimum of ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$min(a,b,...)'' is the same as ''$min($min(a,b),...)''.<br />
<br />
=== $mod(a,b) ===<br />
<br />
Computes the remainder of dividing ''a'' through ''b''. The result has the same sign as ''a''. If ''b'' evaluates to zero, the result is ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mod(a,b,...)'' is the same as ''$mod($mod(a,b),...)''.<br />
<br />
=== $mul(a,b) ===<br />
<br />
Multiplies ''a'' and ''b''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$mul(a,b,...)'' is the same as ''$mul($mul(a,b),...)''.<br />
<br />
=== $muldiv(a,b,c) ===<br />
<br />
Multiplies ''a'' and ''b'', then divides by ''c''. The result is rounded to the nearest integer.<br />
<br />
=== $rand() ===<br />
<br />
Generates a random number in the range from 0 to 2<sup>32</sup>-1. Available only in sort-related contexts, such as the ''Edit → Sort → Sort by ...'' menu command.<br />
<br />
=== $sub(a,b) ===<br />
<br />
Subtracts ''b'' from ''a''.<br />
<br />
Can be used with an arbitrary number of arguments. ''$sub(a,b,...)'' is the same as ''$sub($sub(a,b),...)''.<br />
<br />
= Boolean functions =<br />
<br />
The functions in this section can be used to work with truth values (''true'' and ''false''), which have no explicit representation in titleformat scripts. They do not return a string or number value. You can use them for more complex conditions with ''$if'' and related functions.<br />
<br />
=== $and(...) ===<br />
<br />
Logical And of an arbitrary number of arguments. Returns ''true'', if and only if all arguments evaluate to ''true''.<br />
<br />
Special case: ''$and(x,y)'' is ''true'', if both ''x'' and ''y'' are ''true''. Otherwise it is ''false''.<br />
<br />
=== $or(...) ===<br />
<br />
Logical Or of an arbitrary number of arguments. Returns ''true'', if at least one argument evaluates to ''true''.<br />
<br />
Special case: ''$or(x,y)'' is ''true'', if ''x'' or ''y'' is ''true'', or if both are ''true''. Otherwise it is ''false''.<br />
<br />
=== $not(x) ===<br />
<br />
Logical Not. Returns ''false'', if ''x'' is ''true'', otherwise it returns ''true''.<br />
<br />
=== $xor(...) ===<br />
<br />
Logical Exclusive-or of an arbitrary number of arguments. Returns ''true'', if an odd number of arguments evaluate to ''true''.<br />
<br />
Special case: ''$xor(x,y)'' is ''true'', if one of ''x'' and ''y'' is ''true'', but not both. Otherwise it is ''false''.<br />
<br />
= Color functions =<br />
<br />
==For the Default User Interface==<br />
Starting in version 1.0, the Default UI playlist view doesn't support color functions. In that location, text color can only be adjusted via angle-bracket syntax: Use < and > characters to make specific text <dimmed> ''vs.'' the default color or >highlight>ed with the highlight color, with up to three levels in each case, ''e.g.'': <dimmed>, >highlight<, >>more highlight<<, <<<very dim>>>.<br />
<br />
==For Columns UI==<br />
<br />
The playlist in the Columns UI still supports the following functions:<br />
<br />
=== $blend(color1,color2,part,total) ===<br />
<br />
Returns a color that is a blend between ''color1'' and ''color2''. If ''part'' is smaller than or equal to zero, ''color1'' is returned. If ''part'' is greater than or equal to ''total'', ''color2'' is returned. Otherwise a blended color is returned that is ''part'' parts ''color1'' and ''total''-''part'' parts ''color2''. The blending is performed in the RGB color space.<br />
<br />
=== $hsl() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $hsl(h,s,l) ===<br />
<br />
Sets the color for text in the HSL color space. ''h'', ''s'' and ''l'' are the hue, saturation, and lightness of the color for unselected text. The color for selected text is set to the inverse color.<br />
The ranges of ''h'', ''s'', and ''l'' are from 0 to 240; the function is designed to interpret those values in the same way as the standard Windows color dialog.<br />
<br />
=== $hsl(h1,s1,l1,h2,s2,l2) ===<br />
<br />
Sets the color for text in the HSL color space. ''h1'', ''s1'' and ''l1'' are the hue, saturation, and lightness of the color for unselected text. ''h2'', ''s2'' and ''l2'' are the hue, saturation, and lightness of the color for selected text.<br />
<br />
=== $rgb() ===<br />
<br />
Resets the text color to the default color.<br />
<br />
=== $rgb(r,g,b) ===<br />
<br />
Sets the color for text. ''r'', ''g'' and ''b'' are the red, green and blue component of the color for unselected text. The color for selected text is set to the inverse color.<br />
<br />
=== $rgb(r1,g1,b1,r2,g2,b2) ===<br />
<br />
Sets the color for text. ''r1'', ''g1'' and ''b1'' are the red, green and blue component of the color for unselected text. ''r2'', ''g2'' and ''b2'' are the red, green and blue component of the color for selected text.<br />
<br />
=== $transition(string,color1,color2) ===<br />
<br />
Inserts color codes into ''string'', so that the first character has ''color1'', the last character has ''color2'', and intermediate characters have blended colors. The blending is performed in the RGB color space. Note that color codes are additional characters that will also be counted by string manipulation functions. For example, if you need to truncate a string, you should do this before applying ''$transition''.<br />
<br />
= Now playing info =<br />
The following functions and fields are usable for scripts used with the currently playing item, for example the status bar, the main window title and the copy command script. Please note that these special fields will ''not'' work in custom columns.<br />
<br />
== Special fields ==<br />
<br />
=== %playback_time% ===<br />
Returns the elapsed time formatted as [HH:]MM:SS.<br />
<br />
=== %playback_time_seconds% ===<br />
Returns elapsed time in seconds.<br />
Old version: <code>%_time_elapsed%</code><br />
<br />
=== %playback_time_remaining% ===<br />
Returns remaining time until track ends, formatted as [HH:]MM:SS.<br />
Old version: <code>%_time_remaining%</code><br />
<br />
=== %playback_time_remaining_seconds% ===<br />
Returns remaining time in seconds.<br />
Old version: <code>%_time_remaining_seconds%</code><br />
<br />
=== %length% ===<br />
Returns the length of the track formatted as hours, minutes, and seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total%</code><br />
<br />
=== %length_ex% ===<br />
Returns the length of the track formatted as hours, minutes, seconds, and milliseconds, rounded to the nearest millisecond.<br />
<br />
=== %length_seconds% ===<br />
Returns the length of the track in seconds, rounded to the nearest second.<br />
Old version: <code>%_time_total_seconds%</code><br />
<br />
=== %length_seconds_fp% ===<br />
Returns the length of the track in seconds as floating point number.<br />
<br />
=== %length_samples% ===<br />
Returns the length of the track in samples.<br />
<br />
= Playlist info =<br />
The following functions and fields are usable for playlist display formatting (eg. per-column title formatting patterns).<br />
<br />
== Special fields ==<br />
<br />
=== %isplaying% ===<br />
<br />
Returns "1" if file is currently playing and empty string otherwise.<br />
<br />
=== %ispaused% ===<br />
<br />
Returns "1" if playback is paused, empty string otherwise.<br />
<br />
=== %list_index% ===<br />
<br />
Returns a zero-padded playlist index of specified item. The first item is at index 1.<br />
<br />
=== %list_total% ===<br />
<br />
Returns number of items in the playlist.<br />
<br />
=== %queue_index% ===<br />
<br />
Index of the specified item in the playback queue; available in playlist only. If the item has been queued multiple times, %queue_index% evaluates to the first index.<br />
<br />
=== %queue_indexes% ===<br />
<br />
List of indexes of the specified item in the playback queue; available in playlist only. Same as %queue_index% unless the item has been queued more than once.<br />
<br />
=== %queue_total% ===<br />
<br />
Total amount of tracks in playback queue. Available only for queued tracks, for technical reasons. <br />
<br />
= String functions =<br />
<br />
The functions in this section can be used to manipulate character strings.<br />
<br />
=== $abbr(x) ===<br />
<br />
Returns abbreviation of ''x''. Words which begin with an alphanumeric character are shortened to the first character. Spaces and parentheses are stripped. Example:<br />
* $abbr('This is a Long Title (12-inch version) [needs tags]') → TiaLT1v[needst<br />
<br />
=== $abbr(x,len) ===<br />
<br />
Returns abbreviation of ''x'', if ''x'' is longer than ''len'' characters, otherwise returns ''x''.<br />
<br />
=== $ansi(x) ===<br />
<br />
Converts ''x'' to system codepage and back. Any characters that are not present in the system codepage will be removed / replaced. Useful for mass-renaming files to ensure compatibility with non-unicode-capable software.<br />
<br />
=== $ascii(x) ===<br />
<br />
Converts ''x'' to ASCII. Any characters that are not present in ASCII will be removed / replaced.<br />
<br />
=== $caps(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and all other letters to lowercase.<br />
<br />
=== $caps2(x) ===<br />
<br />
Converts first letter in every word of x to uppercase, and leaves all other letters as they are.<br />
<br />
=== $char(x) ===<br />
<br />
Inserts Unicode character with code ''x''. You can search for characters and find the matching decimal number on this [http://www.fileformat.info/info/unicode/char/search.htm site].<br />
<br />
=== $crc32(a) ===<br />
<br />
Computes the CRC32 of the string ''a'' as a number. Intended for use in coloring scripts.<br />
<br />
Example: $rgb($mod($crc32(%album%),256),128,128)<br />
<br />
=== $crlf() ===<br />
<br />
Inserts end-of-line marker (carriage return, line feed). Can be used to generate multiple lines in the output, for example for the tooltip of the system notification area ("systray") icon.<br />
<br />
=== $cut(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $left(a,len). Negative numbers produce the entire string. Examples:<br />
* $cut('abc123',3) → abc<br />
* $cut('abc123',0) → (nothing)<br />
* $cut('abc123',-1) → abc123<br />
<br />
=== $directory(x) ===<br />
<br />
Extracts directory name from the file path ''x''.<br />
<br />
=== $directory(x,n) ===<br />
<br />
Extracts directory name from the file path ''x''; goes up by ''n'' levels.<br />
<br />
=== $directory_path(x) ===<br />
<br />
Extracts directory path from the file path ''x''.<br />
<br />
=== $ext(x) ===<br />
<br />
Extracts file extension from ''x'' which must be a file name or path.<br />
<br />
=== $filename(x) ===<br />
<br />
Extracts file name from full path.<br />
<br />
=== $fix_eol(x) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by " (...)". Otherwise ''x'' is returned unaltered.<br />
<br />
=== $fix_eol(x,indicator) ===<br />
<br />
If ''x'' contains an end-of-line marker (CR-LF), the end-of-line marker and all text to the right of it is replaced by ''indicator''. Otherwise ''x'' is returned unaltered.<br />
<br />
=== $hex(n) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation.<br />
<br />
=== $hex(n,len) ===<br />
<br />
Formats the integer number ''n'' in hexadecimal notation with ''len'' digits. Pads with zeros from the left if necessary.<br />
<br />
=== $insert(a,b,n) ===<br />
<br />
Inserts ''b'' into ''a'' after ''n'' characters.<br />
<br />
=== $left(a,len) ===<br />
<br />
Returns first ''len'' characters from the left of the string ''a''. This function is the same as $cut(a,len). Negative numbers produce the entire string. Examples:<br />
* $left('abc123',3) → abc<br />
* $left('abc123',0) → (nothing)<br />
* $left('abc123',-1) → abc123<br />
<br />
=== $len(a) ===<br />
<br />
Returns length of string ''a'' in characters.<br />
<br />
=== $len2(a) ===<br />
<br />
Returns length of string x in characters, respecting double-width character rules (double-width characters will be counted as two).<br />
<br />
=== $longer(a,b) ===<br />
<br />
Returns ''true'', if string ''a'' is longer than string ''b'', false otherwise.<br />
<br />
=== $lower(a) ===<br />
<br />
Converts ''a'' to lowercase.<br />
<br />
=== $longest(a,...) ===<br />
<br />
Returns the longest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $num(n,len) ===<br />
<br />
Formats the integer number ''n'' in decimal notation with ''len'' characters. Pads with zeros from the left if necessary. ''len'' includes the dash when the number is negative. If ''n'' is not numeric, it is treated as zero. Examples:<br />
<br />
* $num(123,5) → 00123<br />
* $num(-123,5) → -0123<br />
* $num(4.8,5) → 00004<br />
* $num(A1,5) → 00000<br />
<br />
=== $pad(x,len) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds spaces to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad(x,len,char) ===<br />
<br />
Creates a left-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the right of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $pad_right(x,len,char) ===<br />
<br />
Creates a right-aligned version of the string ''x''. If ''x'' is shorter than ''len'' characters, the function adds ''char'' to the left of ''x'' to make the result ''len'' characters long. Otherwise the function returns ''x'' unchanged.<br />
<br />
=== $padcut(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the right of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $padcut_right(x,len) ===<br />
<br />
Returns first ''len'' characters from the left of ''x'', if ''x'' is longer than ''len'' characters. Otherwise adds spaces to the left of ''x'' to make the result ''len'' characters long.<br />
<br />
=== $progress(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with.<br />
<br />
Example:''$progress(%_time_elapsed_seconds%, %_time_total_seconds%, 20,'#','=')'' produces "====#===============", the # character is moving with playback position.<br />
<br />
=== $progress2(pos,range,len,a,b) ===<br />
<br />
Creates a progress bar: ''pos'' contains position, ''range'' contains range, ''len'' progress bar length in characters, ''a'' and ''b'' are characters to build progress bar with. Produces different appearance than ''$progress''.<br />
<br />
=== $repeat(a,n) ===<br />
<br />
Returns ''n'' copies of ''a''. Note that ''a'' is evaluated once before its value is used, so ''$repeat'' cannot be used for loops.<br />
<br />
=== $replace(a,b,c) ===<br />
<br />
Replaces all occurrences of string ''b'' in string ''a'' with string ''c''.<br />
<br />
Can also be used with an arbitrary number of arguments. Note that ''$replace(a,b1,c1,b2,c2)'' is generally not the same as ''$replace($replace(a,b1,c1),b2,c2)''.<br />
<br />
Example: ''$replace(ab,a,b,b,c)'' → "bc", ''$replace($replace(ab,a,b),b,c)'' → "cc"<br />
<br />
=== $right(a,len) ===<br />
<br />
Returns the first ''len'' characters from the right of ''a''.<br />
<br />
=== $roman(n) ===<br />
<br />
Formats the integer number ''n'' in roman notation.<br />
<br />
=== $rot13() ===<br />
<br />
Performs [http://en.wikipedia.org/wiki/ROT13 ROT13] transformation to given string.<br />
<br />
Example: ''$rot13('foobar2000')'' → "sbbone2000".<br />
<br />
=== $shortest ===<br />
<br />
Returns the shortest of its arguments. Can be used with an arbitrary number of strings.<br />
<br />
=== $strchr(s,c) ===<br />
<br />
Finds first occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strchr(abca,a)'' → 1<br />
<br />
=== $strrchr(s,c) ===<br />
<br />
Finds last occurence of character ''c'' in string ''s''.<br />
<br />
Example: ''$strrchr(abca,a)'' → 4<br />
<br />
=== $strstr(s1,s2) ===<br />
<br />
Finds first occurence of string ''s2'' in string ''s1''.<br />
<br />
=== $strcmp(s1,s2) ===<br />
<br />
Performs a case-sensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $stricmp(s1,s2) ===<br />
<br />
Performs a case-insensitive comparison of the strings ''s1'' and ''s2''.<br />
<br />
=== $substr(s,m,n) ===<br />
<br />
Returns substring of string ''s'', starting from ''m''-th character and ending at ''n''-th character.<br />
<br />
=== $stripprefix(x) ===<br />
<br />
Removes ''A'' and ''The'' prefixes from x. <br />
<br />
=== $stripprefix(x,prefix1,prefix2,...) ===<br />
<br />
Removes the specified prefixes from x. <br />
<br />
=== $swapprefix(x) ===<br />
<br />
Moves ''A'' and ''The'' prefixes to the end of x. <br />
<br />
=== $swapprefix(x,prefix1,prefix2,...) ===<br />
<br />
Moves the specified prefixes to the end of x. <br />
<br />
=== $trim(s) ===<br />
<br />
Removes leading and trailing spaces from string ''s''.<br />
<br />
=== $tab() ===<br />
<br />
Inserts one tabulator character.<br />
<br />
=== $tab(n) ===<br />
<br />
Inserts ''n'' tabulator characters.<br />
<br />
=== $upper(s) ===<br />
<br />
Converts string ''s'' to uppercase.<br />
<br />
= Track info =<br />
<br />
The functions and fields in this section can be used to access information about tracks.<br />
<br />
== Metadata ==<br />
<br />
=== $meta(name) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ", " as separator.<br />
<br />
Example: ''$meta(artist)'' → "He, She, It"<br />
<br />
=== $meta(name,n) ===<br />
Returns value of ''n''-th (0,1,2 and so on) tag called ''name''.<br />
<br />
Example: ''$meta(artist,1)'' → "She"<br />
<br />
=== $meta_sep(name,sep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator.<br />
<br />
Example: ''$meta_sep(artist,' + ')'' → "He + She + It"<br />
<br />
=== $meta_sep(name,sep,lastsep) ===<br />
Returns value of tag called ''name''. If multiple values of that tag exist, they are concatenated with ''sep'' as separator between all but the last two values which are concatenated with ''lastsep''.<br />
<br />
Example: ''$meta_sep(artist,', ',', and ')'' → "He, She, and It"<br />
<br />
=== $meta_test(...) === <br />
Returns ''1'', if all given tags exist, ''undefined'' otherwise.<br />
<br />
Example: ''$meta_test(artist,title)'' → true<br />
<br />
=== $meta_num(name) ===<br />
Returns the number of values for the tag called ''name''.<br />
<br />
Example: ''$meta_num(artist)'' → 3<br />
<br />
== Technical information ==<br />
<br />
=== $info(name) ===<br />
Returns value of technical information field called ''name''.<br />
<br />
For convenience, the '''%__name%''' alias is also available.<br />
<br />
Example: ''$info(channels)'' → 2<br />
<br />
Here is an '''informative''' list of recognized fields. Some of these depend on the media file type being queried.<br />
<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! field name<br />
! Description<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''General'''<br />
|-<br />
|codec<br />
| style="background-color:#EEF"|'''Codec''' (''e.g.'' MP3)<br />
|-<br />
|codec_profile<br />
| style="background-color:#EEF"|'''Codec Profile''' (''e.g.'' CBR)<br />
|-<br />
|samplerate<br />
| style="background-color:#EEF"|'''Sample Rate''', in hertz (''e.g.'' 44100)<br />
|-<br />
|bitrate<br />
| style="background-color:#EEF"|'''Bitrate''', in kilobits per second (''e.g.'' 320)<br />
|-<br />
|tool<br />
| style="background-color:#EEF"|'''Tool''' used to produce the file, possibly guessed (''e.g.'' LAME3.97)<br />
|-<br />
|encoding<br />
| style="background-color:#EEF"|'''Encoding''' lossiness (''e.g.'' lossy)<br />
|-<br />
|channels<br />
| style="background-color:#EEF"|'''Channels''' count (''e.g.'' 2 <nowiki>[for stereo]</nowiki>)<br />
|-<br />
|channel_mode<br />
| style="background-color:#EEF"|'''Channel Mode''', description of channels (''e.g.'' 3 front, 2 rear surround channels + LFE)<br />
|-<br />
|bitspersample<br />
| style="background-color:#EEF"|'''Bits Per Sample''' (''e.g.'' 16)<br />
|-<br />
|tagtype<br />
| style="background-color:#EEF"|'''Tag Type''', comma-separated list of tag formats (''e.g.'' id3v2|apev2)<br />
|-<br />
|cue_embedded<br />
| style="background-color:#EEF"|'''Embedded Cuesheet''' presence (''e.g.'' no <nowiki>[may be empty!]</nowiki>)<br />
|-<br />
|md5<br />
| style="background-color:#EEF"|'''Audio MD5''' hash, if container defines it (''e.g.'' 1E24A910D91EF09A8CF403C9B6963961)<br />
|-<br />
| colspan="2" style="background-color:#CCF"|'''Other'''<br />
|-<br />
|ENC_DELAY<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_delay''' value for gapless playback (''e.g.'' 576)<br />
|-<br />
|ENC_PADDING<br />
| style="background-color:#EEF"|LAME proprietary MP3 '''enc_padding''' value for gapless playback (''e.g.'' 1536)<br />
|-<br />
|MP3_ACCURATE_LENGTH<br />
| style="background-color:#EEF"|MP3 duration (%length% etc.) takes into account LAME or iTunes gapless playback info (''e.g.'' yes)*<br />
|-<br />
|MP3_STEREO_MODE<br />
| style="background-color:#EEF"|Stereo mode used in MP3 file (''e.g.'' mono, stereo, joint stereo, etc.)<br />
|-<br />
|VERSION<br />
| style="background-color:#EEF"|'''Version''' of tool (''e.g.'' 3.99)<br />
|-<br />
|FLAGS<br />
| style="background-color:#EEF"|'''Flags''' of tool (''e.g.'' 22)<br />
|}<br />
<br />
* MP3_ACCURATE_LENGTH doesn't exist if gapless playback info isn't present or the file is not an MP3. The gapless playback info can be in a LAME tag in the VBR header, or in an iTunSMPB ID3v2 comment tag. Length does take gapless playback info in .m4a files, but there's no special field to say so.<br />
<br />
=== $channels() === <br />
Returns number of channels in text format.<br />
<br />
Example: ''$channels()'' → "stereo"<br />
<br />
=== %replaygain_album_gain% ===<br />
<br />
Returns ReplayGain album gain value.<br />
<br />
=== %replaygain_album_peak% ===<br />
<br />
Returns ReplayGain album peak value.<br />
<br />
=== %replaygain_track_gain% ===<br />
<br />
Returns ReplayGain track gain value.<br />
<br />
=== %replaygain_track_peak% ===<br />
<br />
Returns ReplayGain track peak value.<br />
<br />
== Special fields ==<br />
<br />
==== %filename% ====<br />
<br />
Returns the filename without directory and extension.<br />
<br />
==== %filename_ext% ====<br />
<br />
Returns the filename with extension, but without the directory.<br />
<br />
==== %directoryname% ====<br />
<br />
Returns the name of the parent directory only, not the complete path.<br />
<br />
==== %last_modified% ====<br />
<br />
Returns the date and time the file was last modified. Eg: ''2005-12-22 00:04:10''<br />
<br />
==== %path% ====<br />
<br />
Returns the path.<br />
<br />
==== %_path_raw% ====<br />
<br />
Returns the path as URL including the protocol scheme.<br />
<br />
==== %subsong% ====<br />
<br />
Returns the subsong index. The subsong index is used to distuingish multiple tracks in a single file, for example for cue sheets, tracker modules and various container formats.<br />
<br />
==== %_foobar2000_version% ====<br />
Returns a string representing the version of foobar2000.<br />
<br />
= Time/Date Functions =<br />
<br />
These functions are used to manipulate time/date strings, notably (but not limited to), [[Foobar2000:Titleformat_Playback_Statistics|those gathered]] by the [[Foobar2000:Components/Playback Statistics v3.x (foo playcount)|Playback Statistics component]].<br />
<br />
=== $year(time) ===<br />
<br />
Retrieves the year part (formatted as four digits) from a time/date string.<br />
<br />
=== $month(time) ===<br />
<br />
Retrieves the month part (formatted as two digits) from a time/date string.<br />
<br />
=== $day_of_month(time) ===<br />
<br />
Retrieves the day of month part (formatted as two digits) from a time/date string.<br />
<br />
=== $date(time) ===<br />
<br />
Retrieves the date part (formatted as YYYY-MM-DD) from a time/date string.<br />
<br />
=== $time(time) ===<br />
<br />
Retrieves the time part (formatted as HH:MM:SS or HH:MM) from a date/time string.<br />
<br />
= Variable operations =<br />
<br />
Variables can be used to store strings and number. They cannot store truth values. They are best used to store intermediate results that you need multiple times. Variable names are not case-sensitive.<br />
<br />
For example:<br />
{| border="0" cellspacing="0" cellpadding="2"<br />
! code<br />
! output<br />
|-<br />
|<pre>$put(foo,bar)$char(10)<br />
$get(foo)$char(10)<br />
$get(Foo)$char(10)<br />
$puts(foo,2000)$char(10)<br />
$get(foo)$char(10)</pre><br />
| style="background-color:#EEF" |<pre>bar<br />
bar<br />
bar<br />
<br />
2000</pre><br />
|}<br />
=== $get(name) ===<br />
<br />
Returns the value that was last stored in the variable ''name'', if the variable was not defined (yet), it returns nothing. The truth value returned by ''$get'' indicates if the variable ''name'' was defined<br />
<br />
=== $put(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns ''value'' unaltered<br />
<br />
=== $puts(name,value) ===<br />
<br />
Stores ''value'' in the variable ''name'' and returns nothing<br />
<br />
= Component-provided fields and functions on tracks =<br />
<br />
This section lists components that provide additional fields and functions that are useable in the context of any track.<br />
<br />
== Playback statistics ==<br />
<br />
* [http://www.foobar2000.org/components/view/foo_playcount Playback statistics homepage]<br />
* [[Foobar2000:Titleformat Playback Statistics|Playback statistics titleformat reference]]<br />
<br />
= Component-specific fields and functions =<br />
<br />
This section lists components that provide additional fields and functions that are only usable in the context of the particular component.<br />
<br />
== Album list ==<br />
* [[Foobar2000:Titleformat_Album_List|Album List Title Formatting]]<br />
* [[Foobar2000:Preferences:Album List|Preferences: Album List]]<br />
== Playlist Organizer ==<br />
* [http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Components/Playlist_Organizer_(foo_plorg)#Nodes Playlist Organizer: Nodes Title Formatting]<br />
<br />
== Columns UI ==<br />
<br />
* [http://yuo.be/columns.php Columns UI homepage]<br />
* [http://yuo.be/wiki/columns_ui:config:global_variables Global variables reference]<br />
* [http://yuo.be/wiki/columns_ui:config:colour_string Playlist colors reference]<br />
* [http://yuo.be/wiki/columns_ui:config:playlist_switcher_titleformatting Playlist switcher reference]<br />
<br />
= Additional Reading =<br />
<br />
* [[Foobar2000:Titleformat_Introduction|Introduction to titleformat scripts]]<br />
* '''titleformat_help.html''' in your Foobar2000 directory (ie C:\Program Files\foobar2000\titleformat_help.html) file:///C:/Program%20Files/foobar2000/titleformat_help.html<br />
<br />
<br />
[[Category:foobar2000 Guides|Titleformat Reference]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Gapless_playbackGapless playback2015-01-12T04:29:51Z<p>Mjb: /* How to add or repair gap metadata in MP3s */</p>
<hr />
<div>'''Gapless playback''' is the seamless playback of sequential audio tracks in digital audio formats. It allows live music or consecutive tracks to be heard exactly as they are mastered, without gaps between tracks.<br />
<br />
==Example==<br />
The typical situation is this:<br />
# Someone uses [[DAE]] software to extract audio data from an audio CD and save it to separate files, one for each track.<br />
# During or after the creation of the files, the audio data is compressed with a lossy codec like MP3.<br />
# Upon playback, a click or a brief (fraction-of-a-second) pause can be heard between tracks.<br />
<br />
Even if two lossily-compressed tracks are decompressed and merged into a single track, a gap will usually remain between them.<br />
<br />
== Why gaps occur ==<br />
There are two main reasons why gaps occur during playback: compression scheme artifacts and poorly designed playback systems.<br />
<br />
=== Compression scheme artifacts ===<br />
Most lossy audio compression schemes add a small amount of silence to both ends of the audio. Due to the introduction of such gaps, the duration of the output is slightly increased. Silence at the beginning is called '''delay''' and silence at the end is '''padding'''. Delay can be called '''encoder delay''' or '''decoder delay''' depending on what part of the compression scheme introduces the delay. Padding normally is only added by the encoder. [[#Common encoder delay values|Common encoder delay values]] are in a table below.<br />
<br />
Many compression schemes involve a time/frequency domain transform (such as an [[MDCT]]) which unavoidably introduces a certain amount of silence (part of the encoder delay) at the beginning of the stream. This gap can be enlarged at decode time when a reverse-MDCT is performed, because the reverse transform will also introduce a gap (decoder delay) of its own.<br />
<br />
Another part of the encoder delay and padding is related to the overlapping nature of MDCT transforms; each segment of the encoded audio depends in part on adjacent segments. Therefore, a little bit of extra signal is required at both ends of the input in order to fully and accurately encode the frequencies found in the original ends. The encoder may add a consistent number of silent samples to one or both ends to achieve this.<br />
<br />
Yet another factor is the fact that transforms act on data in units of fixed-size blocks. In order to fill up the last block, silence may be appended to the input before the transform. This makes the overall padding amount hard to predict, if the length of the input isn't known.<br />
<br />
If the amount of encoder delay and padding are not all accurately accounted for, the encoded silence will be decoded together with the audio data, creating gaps at the ends of the track. Likewise, if the decoder delay is not accounted for, the gap at the end will be further enlarged.<br />
<br />
This issue is technical but also standards-related. The popular [[MP3]] standard, for example, defines no way to record the amount of delay or padding for later removal. Encoder delay may vary from encoder to encoder, making automatic removal difficult. Some encoders use [[MP3#VBRI, XING, and LAME headers|a nonstandard header]] to store actual encoder delay & padding values, but not all players/decoders support it. More recent (newer than MP3) compressed audio formats have been designed to address this problem, and can therefore produce gapless audio if played back correctly.<br />
<br />
=== Poorly designed playback systems ===<br />
Even when the audio file itself does not contain undesirable gaps, software/firmware/hardware design often adds gaps during playback. In some cases, software closes and re-opens the output stream when switching tracks, causing the hardware to create a very short "click". This problem is solved in more sophisticated designs of gapless playback.<br />
<br />
A different design problem relates to software/firmware/hardware which are not ready to seamlessly move to the next track by the time the current track is complete. In this scenario, the listener is left waiting in silence as the player locates the next file, reads it, decodes the first blocks if necessary and then starts loading the buffer for playback. The gap can be as much as half a second, or even more — very noticeable in "continuous" music such as certain classical or dance genres. <br />
<br />
Many older audio players on personal computers do not implement the required buffering to play gapless audio. Some of these rely on third-party gapless audio plug-ins to buffer output. Some newer players and newer versions of old players now support gapless playback directly.<br />
<br />
==CD gaps==<br />
Gapless playback, as discussed here, is ''not'' related to "gaps" or "pregaps" on CDs, at least not directly. Those kinds of gaps are just sections of audio which have been designated on the CD as being the "index 00" portion of each track. They are the audio (often silent or nearly so, but not always) which plays while the CD player counts up from a negative time to 0:00. Some DAE software offers the option of detecting and omitting these sections when ripping. Although this may seem to be a method of creating "gapless" audio, it's merely removing, with only 588-sample (1/75th of a second) precision, chunks of sound based on flags embedded in the CD, not based on how silent the audio actually is. This kind of feature is useful when ripping a CD-R which had been mistakenly burned with 2-second gaps between each track, but when used on a properly mastered commercial CD, it's more likely to just create audible seams where there were none before.<br />
<br />
==Testing for gapless==<br />
The best way to test for gapless playback is by using ''Test Samples'' listed at the end of this page.<br />
<br />
It's tempting to test gapless playback by generating tracks with pure tones, and encoding them into a lossy format. This is not recommended for two reasons:<br />
<br />
# Unless the first tone ends at 0 level and the second tone starts at 0 level, a glitch will be heard during transition.<br />
# Some decoders chop off the end and/or the start of the audio data. So the playback will be perceived as gapless, while it is actually not.<br />
<br />
See the discussion on [http://www.hydrogenaudio.org/forums/index.php?showtopic=40995&st=0&p=360548&#entry360548 this HA thread].<br />
<br />
== Optimal solution ==<br />
It is possible to store metadata in the audio to explicitly declare the playtime, and/or the amount of padding/delays introduced in the encoding process. This information can be used to ensure that playtime will remain constant after decoding with no added silence. The audio playback software must be able to recognize the metadata, and trim the decoded audio as necessary.<br />
<br />
The software can then take care to keep the output stream open between tracks. It must also buffer the beginning of the following track in the same way it buffers the current track during normal playback.<br />
<br />
Optimal gapless audio is achieved if<br />
* the compression method supports gapless playback,<br />
* the software properly decodes the audio data and metadata,<br />
* the next track is buffered and ready to play, and<br />
* the output stream remains open between tracks.<br />
<br />
A collection of consecutive tracks will then play in the same way they were mastered, allowing the listener to hear their album as the author intended.<br />
<br />
== How to add or repair gap metadata in MP3s ==<br />
You will need a wave editor with a proper selection zoom feature (to count samples) and foobar2000 to edit the delay/padding info in the mp3 files.<br />
<br />
# Decode all files to uncompressed wav format with foobar2000 (this is important, because if you open the mp3 directly with the wave editor its internal decoder may add extra silence at the beginning and/or at the end). You need to convert separate tracks to separate wav files, not to a single wav file.<br />
# Determine the encoder delay (number of silent samples at the beginning of each track). This number should be identical for all tracks if they were encoded with the same software. For example, for tracks encoded with [[Gogo]], since it's [[LAME]]-based, the delay should be 576 samples, but it wouldn't hurt to check visually in the editor.<br />
# For each track that should end with gapless transition, determine the number of silent samples at the end (the padding). Unfortunately this procedure can not be reliably automated, because silent samples may not strictly equal zero (due to the encoder filter ringing). You'll need to visually search for the waveform cut-off, which probably won't be abrupt.<br />
# Determine the true length of the track in samples: true length = (raw length) - (encoder delay) - (padding). If the track came from an audio CD, then this number should be a multiple of 588 (the audio CD sector size). If it is not, then either you incorrectly determined the number of padding samples, or the content was not encoded from an audio CD, or possibly it was digitally processed prior to mp3 encoding.<br />
# Edit the mp3 info frame with foobar2000 (local menu -> utilities -> edit mp3 gapless playback information). Enter the encoder delay from step 2 into the "encoder delay" field and the true track length from step 4 into the "padding" field. Save the changes.<br />
<br />
=== Common encoder delay values ===<br />
{|class="wikitable" border=1<br />
!encoder<br />
!delay<br />
|-<br />
|align="right"|'''LAME'''<br />
|align="center"|576 samples<br />
|-<br />
|align="right"|'''iTunes/QuickTime''' MP3<br />
|align="center"|528 samples<br />
|-<br />
|align="right"|'''Windows Media Player/FhG FastEnc'''<br />
|align="center"|672 samples<br />
|}<br />
Additional values for older encoders are given at [http://mp3decoders.mp3-tech.org/decoders_lame.html lame v3.81 and 3.87 beta mp3 decoding quality test results].<br />
<br />
==Alternative solutions==<br />
Digital signal processor ([[DSP]]) plugins can be used to detect silence between tracks and trim the audio as necessary on playback. This is not an optimal solution because it does not always produce results identical to the source. Sometimes an artist may intentionally leave silence at track boundaries for dramatic effect; removing this silence also removes that effect.<br />
<br />
It can also be difficult to properly implement silence removal. If the silence threshold is too low and the track contains decoder artifacts, the software may not recognise some silences. Conversely, if the threshold is too high, the software may remove entire sections of quiet music at the beginning or end of a track.<br />
<br />
DSP plugins can also be used to cross-fade between tracks. This eliminates gaps that some listeners find distracting, but also greatly alters the audio data and is not always desirable. In particular, when tracks are meant to be played together and perform the transition at high volume, cross-fading results in a large volume drop.<br />
<br />
Both of these alternate solutions are typically used to address compression methods that do not support the metadata for gapless playback. Like the optimal solution, they still require buffering and not closing the output stream; however, they require more computations, making them less efficient. In portable digital audio players, this can mean a reduced playing time on batteries.<br />
<br />
Due to the drawbacks of the alternative solutions above, some listeners dislike their negative effects more than the gap they attempt to remove. Another problem is that the solutions above do nothing to prevent the output stream from being closed and reopened at track boundaries; some measures can be taken to simulate a gapless output stream, but they are not always successful and side-effects may occur.<br />
<br />
Another alternative is to ignore track boundaries, encoding a single collection of tracks as a single compressed file, relying on [[cuesheet]]s (or something similar) for navigation. While this method results in gapless playback within the collection of tracks with consecutive playback, it can be unwieldy due to the possibly large size of the resulting compressed file. Furthermore, unless the playback software or hardware can recognize the cue sheets, navigating between tracks may be difficult.<br />
<br />
== Format support ==<br />
Since [[lossless]] data compression excludes the possibility of the introduction of padding, all lossless audio file formats are inherently gapless. The following [[lossy]] audio file formats have provisions for gapless encoding.<br />
<br />
* (Ogg) [[Vorbis]]<br />
* [[Speex]]<br />
<br />
Some other formats do not officially support gapless encoding, but some implementations of encoders or decoders may handle gapless metadata.<br />
<br />
* [[LAME]]-encoded MP3 can be gapless with players that support the LAME Mp3 info tag.<br />
* [[AAC]] in [[MP4]] encoded with Nero Digital from [[Nero AG]] can be gapless with [[foobar2000]].<br />
* AAC in MP4 encoded with iTunes 7.0 can be gapless with iTunes 7.0 and latest foobar2000.<br />
<br />
== Gapless solutions ==<br />
* [[foobar2000]]: Optimal gapless playback<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=18530 Otachan's in_!mpg123]: A gapless [[MP3]] decoder for [[Winamp]]<br />
:'''Note:''' Winamp 5.2 implements gapless playback in its built-in MP3 decoder.<br />
<br />
== Test samples ==<br />
* [http://tiffman.com/gtkpod/gapless_WAVPACK_free_of_right.zip]: 17 very short gapless samples (2 MB)<br />
<br />
== External links ==<br />
* [http://yabb.jriver.com/interact/index.php?topic=47033.msg322589#msg322589 some info about how iTunes/QuickTime writes and handles gapless playback info]<br />
<br />
<br />
[[Category:Technical]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Free_Lossless_Audio_CodecFree Lossless Audio Codec2015-01-10T09:53:43Z<p>Mjb: flac 1.3.1 updates</p>
<hr />
<div>{{Codec Infobox<br />
| name = FLAC<br />
| logo = [[Image:FLAC logo.gif]]<br />
| type = lossless<br />
| purpose = Popular open source patent free lossless compression scheme.<br />
| maintainer = Josh Coalson, Xiph Community <br />
| recommended_encoder = FLAC encoder<br />
| recommended_text = FLAC v1.3.1 (25-11-2014)<br />
| website = http://xiph.org/flac/<br />
}}<br />
'''Free Lossless Audio Codec''' ('''FLAC''') is a codec for lossless audio compression.<br />
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.<br />
<br />
== General aspects of the format ==<br />
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.<br />
<br />
The FLAC project consists of:<br />
* the stream format<br />
* reference encoders and decoders in library form<br />
* flac, a command-line program to encode and decode FLAC files<br />
* metaflac, a command-line metadata editor for FLAC files<br />
* input plugins for various music players<br />
<br />
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.<br />
<br />
== Features ==<br />
* '''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.<br />
* '''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.<br />
* '''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.<br />
* '''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.<br />
* '''Seekable:''' FLAC supports fast sample-accurate seeking. Not only is this useful for playback, it makes FLAC files suitable for use in editing applications.<br />
* '''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.<br />
* '''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.<br />
* '''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.<br />
* '''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.<br />
<br />
== Pros ==<br />
* Portable to many systems<br />
* Open source and freely licensed<br />
* Hardware support (PhatBox, Kenwood MusicKeg, Rio Karma, etc. See below)<br />
* Streaming support<br />
* Extremely fast decoding<br />
* Supports multichannel and high resolution streams<br />
* Supports [[ReplayGain]]<br />
* Supports cue-sheet (with some limitations)<br />
* Gaining wide use as successor to [[Shorten]]<br />
<br />
== Cons ==<br />
* Compresses less efficiently than other popular modern compressors ([[Monkey's Audio]], [[OptimFROG]])<br />
* Higher compression modes slow, for little gain over the default setting.<br />
<br />
== Hardware and software that support FLAC ==<br />
For a more comprehensive list see the [http://xiph.org/flac/links.html FLAC links page].<br />
<br />
=== Hardware ===<br />
==== Car stereo ====<br />
* JVC [http://mobile.jvc.com/product.jsp?pathId=139 KD-X "Digital Media Receivers" series] (almost all)<br />
* Kenwood [http://www.kenwood.com/cs/ce/audiofile/index.php?model=KMM KMM series]<br />
* Soundstream [http://soundstream.com/store/car-video/source-units.html Source Units]<br />
* Tesla Model S<br />
* Citroën DS5<br />
<br />
==== Home stereo ====<br />
* Olive's [http://www.olive.us/ Symphony] wireless digital music center<br />
* [http://www.numark.com/ Numark]'s DJ equipment (HDX and CDX turntables, HDMIX mixer)<br />
* [http://www.sonos.com/ Sonos Digital Music System]<br />
* Slim Devices' [http://www.slimdevices.com/pi_squeezebox.html Squeezebox] networked audio players<br />
<br />
==== Portable ====<br />
* [[Apple iPod]] with [[Rockbox]] firmware<br />
* [[iAudio M3]], M5 and X5<br />
* [[iRiver]] iHP-120/iHP-140 with [[Rockbox]] firmware<br />
* [[Iwod G10]]<br />
* [[Rio Karma]]<br />
* [http://en.wikipedia.org/wiki/SanDisk_Sansa SanDisk Sansa]<br />
* TrekStor's [http://www.trekstor.de/en/products/detail_mp3.php?pid=66 Vibez]<br />
* Devices running Android 3.1+<br />
* [[Pono|Pono Player]]<br />
<br />
=== Software ===<br />
==== Players ====<br />
<br />
'''Windows'''<br />
* [[foobar2000]]<br />
* [[MediaMonkey]]<br />
* [[Winamp]]<br />
*[http://mplayerwin.sourceforge.net/ Mplayer] Console player<br />
* [http://www.cyberlink.com/products/powerdvd-ultra/features_en_US.html?&r=1 PowerDVD]<br />
* [http://www.videolan.org/ VLC]<br />
* [http://www.un4seen.com/ XMplay]<br />
<br />
'''Mac'''<br />
* [http://cogx.org/ Cog]<br />
* [http://www.videolan.org/ VLC]<br />
<br />
'''Linux'''<br />
* [http://www.clementine-player.org/ Clementine]<br />
* [http://www.mplayerhq.hu/ MPlayer]<br />
* [http://www.mythtv.org/ MythTV]<br />
* [http://www.videolan.org/ VLC]<br />
* [[XMMS]]<br />
<br />
==== Frontends (Windows) ====<br />
* FLAC frontend - [http://sourceforge.net/projects/flacfrontend/ download] / [http://wiki.hydrogenaudio.org/index.php?title=Download_page discussion] (ktf)<br />
* Custom [http://members.home.nl/w.speek/flac.htm Windows Frontend] (by Speek)<br />
<br />
==== Frontends (Mac) ====<br />
* [http://www.sbooth.org/Max/ Max]<br />
<br />
==== Converters ====<br />
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / CD Writer<br />
* [http://www.mediamonkey.com/ MediaMonkey] Music Manager / Audio Player / CD Writer<br />
<br />
==== Editors ====<br />
*[http://audacity.sourceforge.net/ Audacity]<br />
* [[Adobe Audition]]<br />
* [http://www.goldwave.com/ GoldWave]<br />
<br />
==== CD writers/rippers ====<br />
* [http://www.nero.com/eng/ Nero]<br />
* [http://arson.sourceforge.net/ Arson]<br />
* [http://www.burrrn.net Burrrn] Audio CD burner<br />
* [[Exact Audio Copy]] CD Ripper<br />
* [http://cdexos.sourceforge.net CDex] CD ripper<br />
* [http://www.cdwave.com/ CD Wave]<br />
* [http://cdburnerxp.se/ CDburner XP] CD writer<br />
* [http://www.mediamonkey.com/ MediaMonkey] - CD ripper/writer<br />
<br />
==== Taggers ====<br />
* [http://www.mp3tag.de/en/index.html Mp3tag] - Universal Tag Editor<br />
* [http://www.jtclipper.eu/thegodfather/ The GodFather] - Tagger / Music manager<br />
* [http://sbooth.org/Tag/ Tag] - for Mac OS X 10.4 (Tiger)<br />
<br />
* [http://www.synthetic-soul.co.uk/tag/ Case's Tag] - Command line tagger<br />
* [https://xiph.org/flac/documentation_tools_metaflac.html metaflac] - for general metadata (including Vorbis comments) maintenance<br />
* [[MediaMonkey]] - Tagger / Music manager (Including multiple and linked album art support)<br />
<br />
==== Other tools ====<br />
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] - tool to multiplex FLAC streams inside the Matroska container<br />
* [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<br />
<br />
for a more comprehensive list use the '''External Links''' bottom of this page to visit flac's download and link page.<br />
<br />
== Frequently asked questions ==<br />
''Question:'' Does the compression level affect decompression speed?<br />
<br />
''Short Answer'': No.<br />
<br />
''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.<br />
<br />
<br />
''Question:'' What is the best compression level for encoding my music?<br />
<br />
''Short Answer'': The default setting, 5.<br />
<br />
''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.<br />
<br />
== See also ==<br />
* [[Lossless]]<br />
* [[Lossless comparison]]<br />
<br />
== External links ==<br />
* [https://xiph.org/flac/ FLAC Homepage] | [https://xiph.org/flac/format.html format description] | [https://xiph.org/flac/documentation.html documentation] | [https://xiph.org/flac/faq.html FAQ] | [https://www.xiph.org/flac/download.html download]<br />
* [http://www.hydrogenaud.io/forums/index.php?showforum=67 FLAC discussion]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=107611 FLAC 1.3.1 discussion]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=107913 FLAC 1.3.1 non-SSE2 build for older CPUs]<br />
* ktf's [http://www.hydrogenaud.io/forums/index.php?showtopic=107990 Lossless codec comparison] 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.<br />
<br />
[[Category:Lossless]]<br />
[[Category:Encoder/Decoder]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Download_pageDownload page2015-01-10T09:46:22Z<p>Mjb: /* Encoders, Decoders, Etc. */ flac links outdated, and many aren't relevant. why link to source code, developer mailing list when the idea is to point people to code they can use?</p>
<hr />
<div>All programs mentioned anywhere in the wiki can be downloaded here.<br />
See also the [[:Category:Software|Software Category]] article for more software not listed here. <br />
<br />
==CD Rippers==<br />
===Windows===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #75A3FF; margin-bottom: 20px;"<br />
|- style="background:#75A3FF"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|-<br />
! align="left" | [[CDex]]<br />
| GPL<br />
| [http://cdexos.sourceforge.net/ here]<br />
| align="left" | An open-source ripper for Windows that uses cdparanoia functionality<br />
|<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[DBpowerAMP with AccurateRip|dBpoweramp]]<br />
| commercial<br />
| [http://www.dbpoweramp.com/ here]<br />
| align="left" | A secure ripper for Windows that includes Accurate Stream functionality.<br />
|-<br />
! align="left" | [[EAC]]<br />
| Free<br />
| [http://www.exactaudiocopy.de/ here]<br />
| align="left" | A secure ripper for Windows, C2 error pointers, Accurate Stream, etc.<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[fre:ac ]]<br />
| GPL<br />
| [http://www.freac.org/ here]<br />
| align="left" | <br />
fre:ac is a free audio converter and CD ripper with support for various popular formats and encoders. Plus supports the CDDB/freedb online CD database which allows you query song information.<br />
|}<br />
<br />
===Mac OS X===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #bbffbb; margin-bottom: 20px;"<br />
|- style="background:#bbffbb;"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|-<br />
! align="left" | [[Max]]<br />
| GPL<br />
| [http://sbooth.org/Max/ here]<br />
| align="left" | A secure ripper for OS X that uses additional cdparanoia functionality<br />
|-<br />
|- style="background-color:#eeeeee;"<br />
! align="left" | [[XLD]]<br />
| GPL<br />
| [http://tmkk.pv.land.to/xld/index_e.html here]<br />
| align="left" | X Lossless Decoder(XLD) is a tool for Mac OS X that is able to decode/convert/play various 'lossless' audio files. The supported audio files can be split into some tracks with cue sheet when decoding. Can convert between many lossless and lossy formats. Plugin oriented design, for easy exchange for new encoders.<br />
|}<br />
<br />
===Linux===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FF8533; margin-bottom: 20px;"<br />
|- style="background:#FF8533;"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:450px;" | Description<br />
|- <br />
! align="left" | abcde <br />
| GPL <br />
|[http://code.google.com/p/abcde/ here] <br />
| align="left" | A command-line based ripper with cdparanoia functionality<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[cdparanoia]]<br />
| BSD, GPL<br />
| [http://www.xiph.org/paranoia/ here]<br />
| align="left" | One of the first secure standalone rippers for the Linux platform<br />
|- <br />
! align="left" | Grip <br />
| GPL <br />
| [http://sourceforge.net/projects/grip/ here] <br />
| align="left" | An open-source Gnome interface ripper that uses cdparanoia functionality <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[Rubyripper]] <br />
| GPL <br />
| [http://code.google.com/p/rubyripper/ here] <br />
| align="left" | A secure ripper for the Linux that uses additional cdparanoia functionality<br />
|}<br />
<br />
==CD/DVD Writers==<br />
===Windows===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #75A3FF; margin-bottom: 20px;"<br />
|- style="background:#75A3FF"<br />
! style="width:185px;" | Name<br />
! style="width:80px;" | Unicode<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:270px;" | Description<br />
|-<br />
! align="left" | [[Burrrn]] (CDA only)<br />
| N<br />
| Free<br />
| [http://www.burrrn.net/ here]<br />
|<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | CDBurnerXP<br />
| <br />
| Free<br />
| [http://www.cdburnerxp.se/ here]<br />
|<br />
|- <br />
! align="left" | DeepBurner <br />
| N<br />
| GPL<br />
| [http://www.deepburner.com/ here]<br />
|<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | InfraRecorder<br />
| N<br />
| GPL<br />
| [http://infrarecorder.org/ here]<br />
| <br />
|-<br />
|}<br />
<br />
===Mac OS X===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #bbffbb; margin-bottom: 20px;"<br />
|- style="background:#bbffbb;"<br />
! style="width:130px;" | Name<br />
! style="width:80px;" | Unicode<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:310px;" | Description<br />
|- <br />
! align="left" | DVD-Audio Tools<br />
| Y <br />
| GPL <br />
| [http://dvd-audio.sourceforge.net/ here] <br />
| align="left" | Open-source DVD-Audio authoring application <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | FireStarter FX<br />
| N <br />
| Free<br />
| [http://wiki.hydrogenaudio.org/index.php?title=FireStarter_FX here] <br />
| align="left" | Free OS X Cocoa CD writing application<br />
|- <br />
! align="left" | X-CD-Roast<br />
| N <br />
| Free <br />
| [http://www.xcdroast.org/xcdr098/xcdrosX.html here] <br />
| align="left" | New OS X port of this Linux CD writing application<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | Burn<br />
| N <br />
| Free<br />
| [http://burn-osx.sourceforge.net/Pages/English/home.html/ here] <br />
| align="left" | Versatile CD/DVD authoring application<br />
|}<br />
<br />
===Linux===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FF8533; margin-bottom: 20px;"<br />
|- style="background:#FF8533;"<br />
! style="width:130px;" | Name<br />
! style="width:80px;" | Unicode<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! align="center" style="width:450px;" | Description<br />
|-<br />
! align="left" | CDRDAO <br />
| N <br />
| GPL <br />
| [http://cdrdao.sourceforge.net/ here] <br />
| align="left" | Cdrdao records audio or data CD-Rs in disk-at-once (DAO) mode<br />
|- style="background-color:#eeeeee;"<br />
! align="left" | DVD-Audio Tools <br />
| Y <br />
| GPL <br />
| [http://dvd-audio.sourceforge.net/ here] <br />
| align="left" | Open-source DVD-Audio authoring application<br />
|-<br />
! align="left" | GnomeBaker<br />
| N<br />
| GPL <br />
| [http://sourceforge.net/projects/gnomebaker/ here] <br />
| align="left" | Popular open-source Gnome interface CD/DVD writing application<br />
|- style="background-color:#eeeeee;"<br />
! align="left" | [[K3b]]<br />
| N<br />
| GPL<br />
| [http://www.k3b.org/ here]<br />
| align="left" | Popular open-source KDE CD writing application for Linux platform <br />
|- <br />
! align="left" | X-CD-Roast <br />
| Y <br />
| GPL <br />
| [http://www.xcdroast.org here] <br />
| align="left" | New open-source Gnome interface CD/DVD writing application<br />
|- style="background-color:#eeeeee;"<br />
! align="left" | Brasero<br />
| N<br />
| GPL<br />
| [http://projects.gnome.org/brasero/ here]<br />
| align="left" | Brasero is a application to burn CD/DVD for the Gnome Desktop.(Gnome Default) <br />
|}<br />
<br />
==Multimedia Players==<br />
===Windows===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #75A3FF; margin-bottom: 20px;"<br />
|- style="background:#75A3FF"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! align="center" style="width:500px;" | Description<br />
|-<br />
! align="left" | [[foobar2000]]<br />
| Free, BSD<br />
| [http://www.foobar2000.org/ here]<br />
| align="left" | Advanced tagging, plugin capabilities, and kernel streaming support<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[MediaMonkey]]<br />
| Free, Shareware<br />
| [http://www.mediamonkey.com/ here]<br />
| align="left" | Supports many Winamp plugins<br />
|-<br />
! align="left" | VUplayer<br />
| Free<br />
| [http://www.vuplayer.com/ here]<br />
| align="left" | Supports many popular digital audio codecs and MOD tracker formats <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[Winamp]]<br />
| Free, Shareware<br />
| [http://www.winamp.com/ here]<br />
| align="left" | Popular audio player for Windows<br />
| align="left" |<br />
|- <br />
! align="left" | [[VLC]]<br />
| LGPL<br />
| [http://www.videolan.org/vlc// here]<br />
| align="left" | VLC media player is a highly portable multimedia player and multimedia framework capable of reading most audio and video formats as well as DVDs, Audio CDs VCDs, and various streaming protocols. <br />
|}<br />
<br />
===Players / Source code ===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #ccccff; margin-bottom: 20px;"<br />
|- style="background:#ccccff"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! align="center" style="width:450px;" | Description<br />
|-<br />
! align="left" | MusikCube<br />
| BSD<br />
| [http://www.musikcube.com/ here]<br />
| align="left" | Supports dynamic playlists and advanced SQL capabilities <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[wxMusik]]<br />
| GPL<br />
| [http://sourceforge.net/projects/musik.berlios/ here]<br />
| align="left" |A cross-platform open-source audio player<br />
|}<br />
<br />
<br />
<br />
===Mac OS X===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #bbffbb; margin-bottom: 20px;"<br />
|- style="background:#bbffbb;"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:450px;" | Description<br />
|- <br />
! align="left" | Cog<br />
| GPL<br />
| [http://cogosx.sourceforge.net/ here]<br />
| align="left" | An open-source digital audio player for OS X.<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | Play<br />
| GPL<br />
| [http://sbooth.org/Play/ here]<br />
| align="left" |Play is an application for playing and managing audio files.<br />
|- <br />
! align="left" | [[VLC]]<br />
| LGPL<br />
| [http://www.videolan.org/vlc// here]<br />
| align="left" | VLC media player is a highly portable multimedia player and multimedia framework capable of reading most audio and video formats as well as DVDs, Audio CDs VCDs, and various streaming protocols. <br />
|}<br />
<br />
<br />
<br />
===Linux===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FF8533; margin-bottom: 20px;"<br />
|- style="background:#FF8533;"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:450px;" | Description<br />
|- <br />
! align="left" | [[Amarok]] <br />
| GPL <br />
| [http://amarok.kde.org/ here] <br />
| align="left" | Popular open-source KDE audio player similiar to Foobar2000<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | Audacious <br />
| [http://opensource.org/docs/osd OSD]<br />
| [http://audacious-media-player.org/ here]<br />
| align="left" |Audacious is an open source audio player<br />
|- <br />
! align="left" | Clementine<br />
| GPL<br />
| [http://www.clementine-player.org/ here]<br />
| align="left" | Cross platform media player, a port of [[Amarok]] 1.4 to the Qt 4 and GStreamer framework, can be controlled with a Wii remote<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | DeaDBeeF<br />
| GPL<br />
| [http://deadbeef.sourceforge.net/ here]<br />
| align="left" | Lightweight music player for Linux, GUI similar to [[Foobar2000]]<br />
|- <br />
! align="left" | [[Rhythmbox]]<br />
| GPL<br />
| [http://projects.gnome.org/rhythmbox/ here]<br />
| align="left" | GNOME music player<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[VLC]]<br />
| LGPL<br />
| [http://www.videolan.org/vlc// here]<br />
| align="left" | VLC media player is a highly portable multimedia player and multimedia framework capable of reading most audio and video formats as well as DVDs, |Audio CDs VCDs, and various streaming protocols. <br />
|- <br />
! align="left" | [[XMMS]] <br />
| GPL <br />
| [http://www.xmms.org/ here] <br />
| align="left" | Popular open-source audio player similiar to Winamp <br />
|}<br />
<br />
=== Console players ===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #CC33CC; margin-bottom: 20px;"<br />
|- style="background:#E1A6FF;"<br />
! style="width:150px;" | Name<br />
! style="width:90px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:350px;" | Description<br />
|-<br />
! align="left" | mpg123<br />
| LGPL<br />
| [http://www.mpg123.org/ here]<br />
| align="left" | mpg123 is a real time MPEG audio player/decoder <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | mplayer for windows<br />
| GPL v2<br />
| [http://mplayerwin.sourceforge.net/ here]<br />
| align="left" | MPlayer is a free and open source media player. <br />
|<br />
|}<br />
<br />
==Tagging Utilities==<br />
===Windows===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #75A3FF; margin-bottom: 20px;"<br />
|- style="background:#75A3FF"<br />
! style="width:150px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|- <br />
! align="left" | MetatOGGer<br />
| Free<br />
| [http://www.luminescence-software.org/ here]<br />
| align="left" | Tags MP3 ([[ID3]]), Ogg files (Vorbis comment, including Ogg FLAC and Speex), Musepack, Windows Media, WavPack et Monkey's Audio<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | MP3 Book Helper<br />
| Free<br />
| [http://mp3bookhelper.sourceforge.net/ here]<br />
| align="left" | Tags [[ID3v1]], ID3v2.3, and Vorbis comments. Features: FreeDB, unicode, guessing and matching, and supporting PAR, SFV, SV, and NFO generation.<br />
|- <br />
! align="left" | [[MP3tag]]<br />
| Free<br />
| [http://www.mp3tag.de/ here]<br />
| align="left" | Tags all files supporting [[ID3]], [[APEv2]], and [[Vorbis_Comment|Vorbis Comments]], not only MP3s<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[Tag.exe]]<br />
| GPL<br />
| [http://www.synthetic-soul.co.uk/tag/ here]<br />
| align="left" | Command-line universal tagger for Windows<br />
|- <br />
! align="left" | Tag &amp; Rename<br />
| Shareware<br />
| [http://www.softpointer.com/tr.htm here]<br />
|<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | TagScanner<br />
| Free<br />
| [http://www.xdlab.ru/en/index.htm here]<br />
|<br />
|- <br />
! align="left" | WMP Tag Plus 2.0<br />
| Free<br />
| [http://bmproductions.fixnum.org/wmptagplus/ here]<br />
| align="left" | Software to integrate other tag format than [[ID3]] into Microsoft Windows Media Player 11.<br />
|}<br />
<br />
===Mac OS X===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #bbffbb; margin-bottom: 20px;"<br />
|- style="background:#bbffbb;"<br />
! style="width:150px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:320px;" | Description<br />
|-<br />
! align="left" | Tag<br />
| GPL<br />
| [http://sbooth.org/Tag/ here]<br />
| align="left" | An open-source tagging application for OS X<br />
|}<br />
<br />
===Linux===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FF8533; margin-bottom: 20px;"<br />
|- style="background:#FF8533;"<br />
! style="width:150px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:450px;" | Description<br />
|-<br />
! align="left" | [[Beets]]<br />
| MIT<br />
| [http://beets.radbox.org/ here]<br />
| align="left" | Cross-platform open source tagging application written in Python, CLI only. Uses the Musicbrainz and Mutagen libraries, still in beta. Mostly automatic, minimal user input required. Many features and plugins. (Read the documentation)<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | EasyTAG<br />
| GPL<br />
| [http://easytag.sourceforge.net/ here]<br />
| align="left" | Gnome tagging utility<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | <br />
|-<br />
! align="left" | Puddletag<br />
| GPLv3<br />
| [http://puddletag.sourceforge.net/index.html here]<br />
| align="left" | Puddletag is a Linux audio tag editor similar to Mp3tag<br />
|}<br />
<br />
==Encoders, Decoders, Etc.==<br />
All basic tools needed to make use of the audio formats supported here.<br />
<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FF0099; margin-bottom: 20px;"<br />
|- style="background:#FF66CC;"<br />
! style="width:100px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|-<br />
! align="left" | [[MP3]]<br />
| GPL<br />
| [http://lame.sourceforge.net/ here]<br />
| align="left" | LAME is a lossy audio compression, <br />
Download win32 binaries [http://www.rarewares.org/mp3.html here], [http://sourceforge.net/projects/lame/files/lame/ source code],<br />
<br />
[[MP3Gain]], a ReplayGain-like utility: [http://mp3gain.sourceforge.net/download.php download here]<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[Opus]]<br />
| GPL<br />
| [http://www.opus-codec.org/ here]<br />
| align="left" | Opus is a totally open, royalty-free codec. It is primarily designed for interactive speech and music transmission over the Internet, but is also applicable to storage and streaming applications.<br />
discussion in the opus [http://www.hydrogenaudio.org/forums/index.php?showforum=71 Forum] Download win32 [https://ftp.mozilla.org/pub/mozilla.org/opus/win32/ binaries]<br />
|-<br />
! align="left" | [[Musepack]]<br />
| GPL<br />
| [http://www.musepack.net/index.php?pg=enc here]<br />
| align="left" | Musepack is a lossy audio compression, <br />
Download MPC for [http://www.musepack.net/index.php?pg=win Windows] [http://www.musepack.net/index.php?pg=lin Linux] [http://musepack.net/index.php?pg=osx Mac OS X] [http://www.musepack.net/index.php?pg=src source code]<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[FLAC]]<br />
| GPL<br />
| [http://xiph.org/flac/index.html here]<br />
| align="left" | FLAC is a lossless audio compression, <br />
CoolEdit / Adobe Audition Filter supporting FLAC: [http://www.vuplayer.com/other.php here]<br />
<br />
Various FLAC-related utilities, including source code and command-line tools, are available on the FLAC [https://xiph.org/flac/download.html download] page.<br />
<br />
|-<br />
! align="left" | qaac <br />
| GPL<br />
| [https://sites.google.com/site/qaacpage/home here]<br />
| align="left" | qaac is a command line AAC/ALAC encoder frontend based on Apple encoder, <br />
Download qaac for windows [https://sites.google.com/site/qaacpage/cabinet here]<br />
discussion in the [http://www.hydrogenaudio.org/forums/index.php?showtopic=85135 Forum]<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[WavPack]]<br />
| GPL<br />
| [http://www.wavpack.com/ here]<br />
| align="left" | WavPack is a hybrid lossless wavefile compressor.<br />
discussion in the WavPack [http://www.hydrogenaudio.org/forums/index.php?showforum=68 Forum], Download WavPack for windows [http://www.wavpack.com/ here] Linux [http://www.wavpack.com/wavpack-4.70.0.tar.bz2 here] Source code [https://github.com/dbry/WavPack here]<br />
|-<br />
|}<br />
<br />
===Ogg [[Vorbis]]===<br />
Currently, all recommended Ogg Vorbis utilities are available at the [http://www.rarewares.org/ogg.html Rarewares Ogg Vorbis page]. The following tools are important:<br />
<br />
* '''OggEnc2''': A command-line Ogg Vorbis encoder that can be used with most CD rippers.<br />
<br />
* '''OggDec''': Command-line decoder.<br />
<br />
* '''[[OggDropXPd]]''': An easy to use, drag'n'drop encoder/decoder with support for automatic tagging, renaming and playlist creation on encoding.<br />
<br />
* ''Encoding DLLs'': For encoding within CDex or WinLame.<br />
<br />
* '''VorbisGain''': The [[ReplayGain]] utility for Ogg Vorbis.<br />
<br />
In addition, the [[Lancer]] suite — a highly SSE-optimized suite of utilities and libraries — are available at [http://homepage3.nifty.com/blacksword/ this page] ''(in Japanese)''. See [[Lancer#Platform-specific Builds|this section]] for information about the different builds.<br />
<br />
==Transcoders==<br />
''Note: Although these tools may convert from one encoding to another, please remember that [[transcoding]] to any [[lossy]] encoding <u>will</u> result in a degraded quality.''<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #99FF99; margin-bottom: 20px;"<br />
|- style="background:#99FF99;"<br />
! style="width:150px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:270px;" | Description<br />
|- <br />
! align="left" | dBpowerAMP<br />
| Shareware<br />
| [http://www.dbpoweramp.com/dmc.htm here]<br />
| align="left" | dBpoweramp Music Converter<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | <br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[foobar2000]]<br />
| Freeware<br />
| [http://www.foobar2000.org/encoderpack here]<br />
| align="left" | foobar2000 Free Encoder Pack<br />
|- <br />
! align="left" | [[fre:ac ]]<br />
| GPL<br />
| [http://www.freac.org/ here] <br />
|<br />
|-style="background-color: #eeeeee;"<br />
! align="left" | TAudioConverter<br />
| GPL<br />
| [http://sourceforge.net/projects/taudioconverter/ here]<br />
| align="left" | discussion in the [http://www.hydrogenaudio.org/forums/index.php?showtopic=98327 Forum] <br />
|- <br />
! align="left" | MediaCoder<br />
| GPL<br />
| [http://www.mediacoderhq.com/ here] <br />
|<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[Winamp]]<br />
| Shareware<br />
| [http://www.winamp.com/ here] <br />
|<br />
|- <br />
! align="left" | WinLAME<br />
| GPL<br />
| [http://winlame.sourceforge.net/ here] <br />
|<br />
|}<br />
<br />
==Processing utilities==<br />
===Windows===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #33CCFF; margin-bottom: 20px;"<br />
|- style="background:#33CCFF;"<br />
! style="width:120px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | [[lossyWAV]]<br />
| GPL<br />
| [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=56129&view=findpost&p=504087 here]<br />
| align="left" | lossyWAV is a lossy pre-processor for [[Wikipedia:Pulse-code modulation|PCM]] (uncompressed) WAV files. It reduces [[Wikipedia:Audio bit depth|bit depth]] of the input signal, which, when used in conjunction with certain lossless codecs, reduces the bitrate of the encoded file significantly.<br />
|}<br />
Note: Windows users may require the pthreadGC2.dll for lossywav to Run: [http://www.mirrorservice.org/sites/sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release/dll/x86/ x86] v2.9.1.0<br />
<br />
==Drivers==<br />
===ASPI===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #FFFF66; margin-bottom: 20px;"<br />
|- style="background:#FFFF66;"<br />
! style="width:160px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:300px;" | Description<br />
|- <br />
! align="left" | Ahead Nero ASPI Driver<br />
| <br />
| [ftp://ftp6.nero.com/wnaspi32.dll here]<br />
| align="left" | wnaspi32.dll<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | Adaptec Windows ASPI Package<br />
| <br />
| [http://www.adaptec.com/en-us/support/_eol/scsi_sw/aspi-4.70/ here]<br />
| align="left" | adaptec aspi<br />
|- <br />
! align="left" | ForceASPI<br />
| <br />
| [http://radified.com/ASPI/forceaspi.htm here]<br />
| align="left" | forceaspi<br />
|- style="background-color: #eeeeee;"<br />
! align="left" | ASPI4all <br />
| <br />
| [http://www.cdr-zone.com/software/aspi_layers/aspi4all.html here]<br />
| align="left" | via cdr-zone.com<br />
|- <br />
! align="left" | FrogAspi<br />
| <br />
| [http://www.frogaspi.org/ here]<br />
| align="left" | frogaspi<br />
|- <br />
|- <br />
! align="left" | VOB ASAPI Driver<br />
| <br />
| [http://www.rarewares.org/files/ASAPI.exe here]<br />
| align="left" | ASAPI.exe 1.3<br />
|}<br />
<br />
===Sound===<br />
* ALSA Project [http://www.alsa-project.org/ official website]<br />
* kX Project [http://kxproject.lugosoft.com/ official website]<br />
<br />
===Links===<br />
{| border="0" cellpadding="0" cellspacing="1" style="text-align:center; border:2px solid #CFE2E6; margin-bottom: 20px;"<br />
|- style="background:#99d4dc;"<br />
! style="width:120px;" | Name<br />
! style="width:100px;" | License<br />
! style="width:100px;" | Website<br />
! style="width:500px;" | Description<br />
|- style="background-color: #;"<br />
! align="left" | Rarewares<br />
|<br />
| [http://www.rarewares.org/index.php here]<br />
| align="left" | All the latest media utilities.<br />
|}<br />
<br />
[[Category:Software]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAME_-q_switchLAME -q switch2014-11-07T16:52:16Z<p>Mjb: /* External links */ link formatting fixes</p>
<hr />
<div>When using [[LAME]] from the command line, the switch '''-q''' (quality) can be added in either VBR or CBR mode to alter various parameters used when encoding, which are predicted (at least in theory) to affect the quality of the output MP3 stream.<br />
<br />
==Equivalences==<br />
===CBR===<br />
Some values of -q seem to produce equivalent files, at least in terms of the audio itself.<br />
* -q5 and -q6 output identical results. LAME's header will indicate the different quality parameter, but the files, including the actual audio, are otherwise a perfect match.<br />
* -q8 is always mapped to -q7 and thus outputs identical files, including the header.<br />
* -q9 outputs the same file as -q7 and -q8, although the official documentation describes it as a different quality. The LAME header will be different for CBR/ABR and identical for VBR.<br />
<br />
===VBR===<br />
VBR encoding modes take some different code paths and ignore some of the listed values. In particular, the ten values of -q are mapped to just 3 values under VBR as of 3.98 and later:<br />
* -q7 to -q9 are mapped to -q7. This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a quick guess.<br />
* -q5 and -q6 include all features of -q7, calculate and consider actual quantisation noise, and additionally enable subblock gain.<br />
* -q0 to -q4 include all features of higher numbers and additionally use the best search when applying Huffman coding.<br />
<br />
==Effects==<br />
This table documents the parameters that are affected by the value assigned to -q. '''These are most relevant to CBR''' for the reasons noted above.<br />
{| border=1 class="wikitable" style="text-align:center"<br />
! -q n !! Huffman coding search !! Use full outer loop for Huffman encoding !! sv_qnt.substep_shaping !! Subblock gain !! Noise-shaping !! Amplification !! Stopping !! Description<br />
|-<br />
| 0 || Best || Yes || 2 || 1 || Yes || 2 || 1 || align="left" | Use all the slowest parameters/algorithms that are available.<br />
|-<br />
| 1 || Best || No || 2 || 1 || Yes || 2 || 1 ||<br />
|-<br />
| 2 || Best || No || 2 || 1 || Yes || 1 || 1 || align="left" | Same as -h. Higher quality than the default -q3. -q2 was the default in older versions of LAME.<br />
|-<br />
| 3 || Best || No || ? || 1 || Yes || 1 || 1 || align="left" | Default value. Good speed, good quality. Lower values of -q may not produce significantly higher quality.<br />
|-<br />
| 4 || Best || No || ? || 1 || Yes || 0 || 0 || align="left" | Optimal speed/quality. Usually produce less distortion at high frequencies than all other values of -q, except 5-6.<br />
|-<br />
| 5-6 || Normal || No || ? || 1 || Yes || 0 || 0 || align="left" | Almost the same as -q4.<br />
|-<br />
| 7-8 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but no noise-shaping is done.<br />
|-<br />
| 9 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Disables almost all algorithms including psy-model. Extremely fast. OK quality.<br />
|}<br />
<br />
==External links==<br />
* [http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/detailed.html#q Current documentation]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=101132 Research & discussion that led to this summary] (2013)<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=107424 More discussion mainly re: ABR] (2014)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAME_-q_switchLAME -q switch2014-11-07T16:51:21Z<p>Mjb: +link to docs</p>
<hr />
<div>When using [[LAME]] from the command line, the switch '''-q''' (quality) can be added in either VBR or CBR mode to alter various parameters used when encoding, which are predicted (at least in theory) to affect the quality of the output MP3 stream.<br />
<br />
==Equivalences==<br />
===CBR===<br />
Some values of -q seem to produce equivalent files, at least in terms of the audio itself.<br />
* -q5 and -q6 output identical results. LAME's header will indicate the different quality parameter, but the files, including the actual audio, are otherwise a perfect match.<br />
* -q8 is always mapped to -q7 and thus outputs identical files, including the header.<br />
* -q9 outputs the same file as -q7 and -q8, although the official documentation describes it as a different quality. The LAME header will be different for CBR/ABR and identical for VBR.<br />
<br />
===VBR===<br />
VBR encoding modes take some different code paths and ignore some of the listed values. In particular, the ten values of -q are mapped to just 3 values under VBR as of 3.98 and later:<br />
* -q7 to -q9 are mapped to -q7. This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a quick guess.<br />
* -q5 and -q6 include all features of -q7, calculate and consider actual quantisation noise, and additionally enable subblock gain.<br />
* -q0 to -q4 include all features of higher numbers and additionally use the best search when applying Huffman coding.<br />
<br />
==Effects==<br />
This table documents the parameters that are affected by the value assigned to -q. '''These are most relevant to CBR''' for the reasons noted above.<br />
{| border=1 class="wikitable" style="text-align:center"<br />
! -q n !! Huffman coding search !! Use full outer loop for Huffman encoding !! sv_qnt.substep_shaping !! Subblock gain !! Noise-shaping !! Amplification !! Stopping !! Description<br />
|-<br />
| 0 || Best || Yes || 2 || 1 || Yes || 2 || 1 || align="left" | Use all the slowest parameters/algorithms that are available.<br />
|-<br />
| 1 || Best || No || 2 || 1 || Yes || 2 || 1 ||<br />
|-<br />
| 2 || Best || No || 2 || 1 || Yes || 1 || 1 || align="left" | Same as -h. Higher quality than the default -q3. -q2 was the default in older versions of LAME.<br />
|-<br />
| 3 || Best || No || ? || 1 || Yes || 1 || 1 || align="left" | Default value. Good speed, good quality. Lower values of -q may not produce significantly higher quality.<br />
|-<br />
| 4 || Best || No || ? || 1 || Yes || 0 || 0 || align="left" | Optimal speed/quality. Usually produce less distortion at high frequencies than all other values of -q, except 5-6.<br />
|-<br />
| 5-6 || Normal || No || ? || 1 || Yes || 0 || 0 || align="left" | Almost the same as -q4.<br />
|-<br />
| 7-8 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but no noise-shaping is done.<br />
|-<br />
| 9 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Disables almost all algorithms including psy-model. Extremely fast. OK quality.<br />
|}<br />
<br />
==External links==<br />
* [http://lame.cvs.sourceforge.net/viewvc/lame/lame/doc/html/detailed.html#q]Current documentation[/url]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=101132]Research & discussion that led to this summary[/url] (2013)<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=107424]More discussion re: ABR[/url] (2014)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAME_-q_switchLAME -q switch2014-11-07T16:48:12Z<p>Mjb: It's nice to know where this came from</p>
<hr />
<div>When using [[LAME]] from the command line, the switch '''-q''' (quality) can be added in either VBR or CBR mode to alter various parameters used when encoding, which are predicted (at least in theory) to affect the quality of the output MP3 stream.<br />
<br />
==Equivalences==<br />
===CBR===<br />
Some values of -q seem to produce equivalent files, at least in terms of the audio itself.<br />
* -q5 and -q6 output identical results. LAME's header will indicate the different quality parameter, but the files, including the actual audio, are otherwise a perfect match.<br />
* -q8 is always mapped to -q7 and thus outputs identical files, including the header.<br />
* -q9 outputs the same file as -q7 and -q8, although the official documentation describes it as a different quality. The LAME header will be different for CBR/ABR and identical for VBR.<br />
<br />
===VBR===<br />
VBR encoding modes take some different code paths and ignore some of the listed values. In particular, the ten values of -q are mapped to just 3 values under VBR as of 3.98 and later:<br />
* -q7 to -q9 are mapped to -q7. This level uses a psymodel but does not calculate quantisation noise when encoding: it takes a quick guess.<br />
* -q5 and -q6 include all features of -q7, calculate and consider actual quantisation noise, and additionally enable subblock gain.<br />
* -q0 to -q4 include all features of higher numbers and additionally use the best search when applying Huffman coding.<br />
<br />
==Effects==<br />
This table documents the parameters that are affected by the value assigned to -q. '''These are most relevant to CBR''' for the reasons noted above.<br />
{| border=1 class="wikitable" style="text-align:center"<br />
! -q n !! Huffman coding search !! Use full outer loop for Huffman encoding !! sv_qnt.substep_shaping !! Subblock gain !! Noise-shaping !! Amplification !! Stopping !! Description<br />
|-<br />
| 0 || Best || Yes || 2 || 1 || Yes || 2 || 1 || align="left" | Use all the slowest parameters/algorithms that are available.<br />
|-<br />
| 1 || Best || No || 2 || 1 || Yes || 2 || 1 ||<br />
|-<br />
| 2 || Best || No || 2 || 1 || Yes || 1 || 1 || align="left" | Same as -h. Higher quality than the default -q3. -q2 was the default in older versions of LAME.<br />
|-<br />
| 3 || Best || No || ? || 1 || Yes || 1 || 1 || align="left" | Default value. Good speed, good quality. Lower values of -q may not produce significantly higher quality.<br />
|-<br />
| 4 || Best || No || ? || 1 || Yes || 0 || 0 || align="left" | Optimal speed/quality. Usually produce less distortion at high frequencies than all other values of -q, except 5-6.<br />
|-<br />
| 5-6 || Normal || No || ? || 1 || Yes || 0 || 0 || align="left" | Almost the same as -q4.<br />
|-<br />
| 7-8 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Same as -f. Very fast, OK quality. Psychoacoustics are used for pre-echo and mid/side stereo, but no noise-shaping is done.<br />
|-<br />
| 9 || Normal || No || ? || -1 || No || 0 || 0 || align="left" | Disables almost all algorithms including psy-model. Extremely fast. OK quality.<br />
|}<br />
<br />
==External links==<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=101132]Research & discussion that led to this summary[/url] (2013)<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=107424]More discussion re: ABR[/url] (2014)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=ReplayGainReplayGain2014-11-05T20:10:46Z<p>Mjb: /* foobar2000 ReplayGain scanner */ minor adj. to prev.</p>
<hr />
<div>'''ReplayGain''' is the name of a technique invented to achieve the same perceived playback loudness of audio files. It defines an algorithm to measure the '''perceived''' loudness of audio data.<br />
<br />
ReplayGain allows the loudness of each song within a collection of songs to be consistent. This is called 'Track Gain' (or 'Radio Gain' in earlier parlance). It also allows the loudness of a specific sub-collection (an "album") to be consistent with the rest of the collection, while allowing the dynamics from song to song on the album to remain intact. This is called 'Album Gain' (or 'Audiophile Gain' in earlier parlance). This is especially important when listening to classical music albums, because quiet tracks need to remain a certain degree quieter than the louder ones.<br />
<br />
ReplayGain is different from [[Normalization|peak normalization]]. Peak normalization merely ensures that the peak amplitude reaches a certain level. This does not ensure equal loudness. The ReplayGain technique measures the ''effective power'' of the waveform (i.e. the RMS power after applying an "equal loudness contour"), and then adjusts the amplitude of the waveform accordingly. The result is that Replay Gained waveforms are usually more uniformly amplified than peak-normalized waveforms.<br />
<br />
==Target loudness==<br />
The target loudness of almost all ReplayGain utilities is 89 dB SPL (an early departure from the proposal, endorsed by its author<ref>[http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=83397&view=findpost&p=721854 Does Replay gain work differtly in Media monkey]</ref>) &mdash; the ReplayGain proposal and SMPTE recommendation are 6dB lower.<ref>[http://www.mars.org/mailman/public/mad-dev/2004-February/000993.html ReplayGain discussion at mad-dev]</ref><br />
<br />
==Clipping==<br />
Audio is generally recorded such that the loudest sounds don't clip, but the use of ReplayGain can cause clipping if the average volume of a song is below the target level. That is, upon playback, the volume of a quiet song is increased, so the parts of the song with above-average loudness, especially in the bass frequencies, will exceed the limits of the format and will be distorted. Whether this distortion is audible depends on the sounds in question, and the listener's sensitivity.<br />
<br />
Implementations deal with the risk of clipping in different ways. Some have a "pre-amp" feature which reduces (or boosts) the original audio's level by a certain amount before doing whatever is needed for ReplayGain. Some have a "prevent clipping" feature to reduce the amount of ReplayGain adjustment to whatever amount would keep clipping from occurring, based on peak info stored in the file's metadata (thus reducing the effectiveness of ReplayGain). Some recommend using a compressor/limiter DSP to prevent or reduce clipping, regardless of whether it was caused by ReplayGain.<br />
<br />
== Implementations ==<br />
There are different ReplayGain implementations, each with its own uses and strength. Most use [[metadata]] to indicate the level of the volume change that the player should make. Some modify the audio data itself, and optionally use metadata as well. There are advantages and disadvantages to both methods.<br />
<br />
In the metadata method, information on both types of ReplayGain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use ReplayGain information stored in metadata. And there's no standard for where and how ReplayGain info is stored; each implementation uses different formats and puts the info in different locations.<br />
<br />
In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of ReplayGain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence).<br />
<br />
=== MP3Gain ===<br />
[[MP3Gain]] is an implementation of ReplayGain. It can be used to just analyze files & recommend changes or to also modify the gain. If modifying the gain, it always modifies the global gain fields in the MP3 audio data. It can add somewhat precise metadata, including undo info. The gain can be modified to any target dB, or it can be changed by a specified amount. For balance correction, user-specified changes can even be made on just one channel in simple L/R stereo-mode files (not joint stereo).<br />
<br />
* Format: [[MP3]]<br />
* Method: Audio + Meta (in APE tag), or Audio only<br />
* APE tag fields (ASCII bytes):<br />
** <code>MP3GAIN_MINMAX ###,###</code> - minimum & maximum global gain values for this file. 3 digits, zero-padded if necessary.<br />
** <code>MP3GAIN_ALBUM_MINMAX ###,###</code> - minimum & maximum global gain values across a set of files scanned as an album. Optional.<br />
** <code>MP3GAIN_UNDO +###,+###,N</code> - the global gain adjustment to restore the original values in the left and right channels, respectively, followed by an indicator of whether to wrap at the extremes (<code>N</code> means no, <code>W</code> means yes). The adjustment values are 3 digits, zero-padded, preceded by a sign (<code>+</code> or <code>-</code>).<br />
** <code>REPLAYGAIN_TRACK_GAIN +#.###### dB</code> - The value is always 9 characters including the sign and decimal point. Examples: <code>+0.424046</code> and <code>-10.38500</code><br />
** <code>REPLAYGAIN_TRACK_PEAK #.###### dB</code> - The value is always 8 characters including the decimal point. Example: <code>0.149923</code><br />
** <code>REPLAYGAIN_ALBUM_GAIN +#.###### dB</code> - The value is always 9 characters including the sign and decimal point. Optional.<br />
** <code>REPLAYGAIN_ALBUM_PEAK #.###### dB</code> - The value is always 8 characters including the decimal point. Optional.<br />
* Limitations: Although the metadata, if written, contains precise adjustment & peak values, the audio data modifications are limited to 1.5dB steps and may become irreversible (however, that's a very rare condition; see the [http://www.hydrogenaudio.org/forums/lofiversion/index.php/t34154.html "mp3gain is NOT lossless" forum thread])<br />
* http://mp3gain.sourceforge.net/<br />
<br />
=== AACGain ===<br />
[[AACGain]] is a modified version of MP3Gain that works on both MP3 and AAC files.<br />
<br />
* Format: [[MP3]], [[AAC]] (with or without MP4 container)<br />
* Method: Audio + Meta, or Audio only<br />
* Limitations: Limited to 1.5dB steps mode, may become irreversible (same caveat as for MP3Gain)<br />
* http://aacgain.altosdesign.com/<br />
<br />
=== [[LAME]] ===<br />
* Method: Header ([http://gabriel.mp3-tech.org/mp3infotag.html mp3infotag])<br />
* Notes:<br />
** Tags added during encoding; not supported by any player yet; Track Gain only<br />
** Replay Gaining MP3's are usually done using MP3Gain (see [[ReplayGain#MP3Gain|above]]) or [[ReplayGain#foobar2000 ReplayGain scanner|foobar2000]]<br />
* http://lame.sourceforge.net/<br />
<br />
=== [[Musepack]] ReplayGain ===<br />
* Method: Header (similar to Meta data method)<br />
* Notes: ReplayGain values are stored in the header and ReplayGain is part of the Musepack specifications; therefore any Musepack decoder that does not support ReplayGain can be considered broken.<br />
* http://www.musepack.net/<br />
<br />
=== VorbisGain ===<br />
* Format: (Ogg) [[Vorbis]]<br />
* Method: Meta (in [[Vorbis comment]])<br />
* http://www.sjeng.org/vorbisgain.html<br />
** new compiles of VorbisGain at [http://www.rarewares.org/ogg.html www.rarewares.org]<br />
:'''''Note:''' Andavari has provided a very useful script to integrate VorbisGain, which is a CLI tool, into Windows Explorer. Please (Ogg) [[Vorbis#Replay Gain|check this section]].<br />
<br />
=== FLAC / METAFLAC ===<br />
* Format: [[Free Lossless Audio Codec|FLAC]]<br />
* Method: Meta (in [[Vorbis comment]])<br />
* http://flac.sf.net<br />
<br />
=== WavPack / WVGAIN ===<br />
* Format: [[WavPack]]<br />
* Method: Meta (in [[APEv2]] tag)<br />
* http://www.wavpack.com<br />
<br />
=== Wavegain ===<br />
* Format: waveform<br />
* Method: Audio<br />
* Limitations: Irreversible<br />
* http://www.rarewares.org/others.php#wavegain<br />
<br />
=== MusicPlayer ===<br />
* Custom implementation, not derived from the original MP3Gain one (but inspired from). As far as I know, all other implementations are directly derived from the MP3Gain (gain_analysis.c, which is GPL) source.<br />
* Format: any that FFmpeg supports<br />
* Method: Audio<br />
* Limitations: Doesn't modify the files at all. Stores the value in own database. Used only for playback.<br />
* https://github.com/albertz/music-player<br />
<br />
=== [[foobar2000]] ReplayGain scanner ===<br />
* Format:<br />
** [[MP3]]: Values written to [[ID3v2]] (default) or [[APEv2]] tags. A separate function can be invoked to apply the tagged Track or Album Gain to the MP3 global gain fields (as MP3Gain does), and rewrite any existing tags to account for the peak change and compensate for the difference from 89&nbsp;dB. The 89&nbsp;dB reference level for tags isn't configurable, but the reference level applied to the global gain fields is (it's under Preferences > Advanced > Tools > ReplayGain Scanner > Target MP3 alteration volume level).<br />
** [[Musepack]]: Values written to header.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WavPack]]: Values written to [[APEv2]] tags.<br />
** [[AAC]]: Values written to [[APEv2]] tags. As with MP3, it is also an option to apply gain via a separate function.<br />
** [[MP4]]: Uses its own iTunes-compatible tagging system (though iTunes does not support ReplayGain).<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** Modules ([[MOD]] etc.): Optionally saved into [[APEv2]] tags.<br />
* http://foobar2000.org<br />
<br />
=== [[MediaMonkey]] ===<br />
* Format:<br />
** [[MP3]]: Values written to [[APEv2]] or [[ID3v2]] tags.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WMA]]: Values stored in MediaMonkey's MDB database.<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** [[WAV]]: Values stored in MediaMonkey's MDB database.<br />
** [[MPC]]: Internal gain Structure.<br />
* In addition to tags, all ReplayGain values are also stored in MediaMonkey's MDB database<br />
* Album/Audiophile ReplayGain not supported until v3.0 (Dec 2007); support during burning & ripping added in 3.1 (Jun 2009)<br />
* Also capable of (irreversibly) changing the volume of MP3 tracks, similar to [[MP3Gain]]<br />
* http://www.mediamonkey.com/<br />
<br />
=== [[Winamp]] ReplayGain scanner===<br />
* Format:<br />
** [[MP3]]: Values written to [[ID3v2]] tags.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WMA]]: Values stored in Windows Media Audio tags.<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** [[AAC]]: Values written to [[APEv2]] tags.<br />
** [[MP4]]<br />
** [[TAK]]: Values written to [[APEv2]] tags.<br />
* Support Album/Track Gain<br />
<br />
== Players support ==<br />
ReplayGain being present in the specs of FLAC, Musepack, and APE formats, any player that support those formats usually support ReplayGain.<br />
<br />
The situation with MP3 is rather different, as it was not part of the MP3 specs. The APEv2 tags metadata implementation is somewhat becoming the de-facto standard.<br />
<br />
=== Windows ===<br />
* [[foobar2000]] supports ReplayGain in all possible aspects.<br />
* [[Winamp]] supports ReplayGain in album or track mode.<br />
* [[MediaMonkey]] supports ReplayGain, with many configuration options.<br />
* [[XMPlay]] recently implemented ReplayGain<br />
<br />
''...and probably others.''<br />
<br />
=== Linux ===<br />
* [[XMMS]]. Reads ReplayGain from [[Free Lossless Audio Codec|FLAC]], [[Musepack]], (Ogg) [[Vorbis]] ..<br />
:For [[MP3]], use the CVS version of the [http://xmms-mad.sourceforge.net/ xmms-mad] mp3 plugin (it's not yet released as binary, furthermore not available in distribs' versions for now. Meanwhile binaries are available here: [http://perso.crans.org/~krempp/xmms-mad/ custom binaries])<br />
* [[amarok]]. By using the amarok-script [http://kde-apps.org/content/show.php?content=26073 ReplayGain]<br />
:And possibly others, since [http://developer.kde.org/~wheeler/taglib.html TagLib] added support for [[APEv2]] tags in [[MP3]] files, players using this library (like [[amaroK]] and [[JuK]]) might support that kind of ReplayGain tags in the near future.<br />
* [http://www.sacredchao.net/quodlibet Quod Libet] reads ReplayGain from (Ogg) [[Vorbis]], [[MP3]], [[Free Lossless Audio Codec|FLAC]], and [[Musepack]].<br />
:Requires support to be enabled (via the appropriate python bindings and libraries) for the above formats. Does not support ReplayGain values stored in [[APEv2]] tags in [[MP3]]s. ReplayGain values are stored in RVA2 id3v2.4 frames. See the [http://www.sacredchao.net/quodlibet/wiki/Development/ID3Notes Quod Libet RVA2 / ReplayGain notes].<br />
* [http://www.musicpd.org/ Music Player Daemon] (MPD) reads ReplayGain from (Ogg) [[Vorbis]], [[Free Lossless Audio Codec|FLAC]], and [[Musepack]].<br />
:foobar2000-style TXXX frames in [[MP3]]s are also supported in the latest development releases.<br />
* [http://www.mplayerhq.hu/ MPlayer]. Mplayer support for ReplayGain is codec dependent.<br />
:Codecs that are known to support ReplayGain: vorbis<br />
:Because of this, you need to prioritize the codecs that support it, or choose it individually on the command line. To add it to the command line, add an -ac [codec] option after each file that you want to choose the codec for, or at the beginning to make it apply to all files listed. To prioritize the codecs by default, list them in a line in mplayer.conf:<br />
ac=[codec],[othercodec],vorbis,mad,<br />
<br />
=== Portable devices ===<br />
[http://www.rockbox.org/ Rockbox] supports ReplayGain (in album or track mode) for most formats, including WMA, MP1/2/3, AAC, ALAC, Musepack, Monkey's Audio, Wavpack, FLAC and Vorbis. <br>Note that ReplayGain is only supported when using the respective codec's native tagging format. For example: ReplayGain stored in APEv2 tags is not supported for MP3, rather ID3v2.x tags are expected.<br />
<br />
Sandisk Sansa Fuze with firmware 1.02.26 and 2.02.26<br />
<br />
Sandisk Sansa Clip+<br />
<br />
The iPod features ''Soundcheck'', which seems to produce roughly the same normalization gains as ReplayGain, but doesn't provide an Album Gain.<br />
<br />
=== Hi-Fi ===<br />
Slim Devices a company owned by Logitech Inc, supports ReplayGain on both of their hi-end audiophile players, known as the [[Slim Devices Transporter|Transporter]] and the [[Slim Devices Squeezebox|Squeezebox]].<br />
<br />
==Notes==<br />
<small><references/></small><br />
<br />
== See also ==<br />
* [[ReplayGain specification]]<br />
<br />
== External links ==<br />
* [http://en.wikipedia.org/wiki/Replay_Gain ReplayGain] at Wikipedia<br />
* [http://www.replaygain.org/ ReplayGain - A Proposed Standard], the original proposal, now out of date with respect to current practice<br />
* [http://www.bobulous.org.uk/misc/Replay-Gain.html ReplayGain using foobar2000] (how to use ReplayGain in Windows using foobar2000).<br />
* [http://www.bobulous.org.uk/misc/Replay-Gain-in-Linux.html ReplayGain in Linux] (how to use ReplayGain in Linux using foobar2000 and Wine, or using metaflac or vorbisgain).<br />
<br />
<br />
[[Category:Technical]]<br />
[[Category:Metadata]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=ReplayGainReplayGain2014-11-05T20:10:00Z<p>Mjb: /* foobar2000 ReplayGain scanner */ apply gain support for AAC has been in for a while. apply gain will not add tags if the file is not currently RG-tagged.</p>
<hr />
<div>'''ReplayGain''' is the name of a technique invented to achieve the same perceived playback loudness of audio files. It defines an algorithm to measure the '''perceived''' loudness of audio data.<br />
<br />
ReplayGain allows the loudness of each song within a collection of songs to be consistent. This is called 'Track Gain' (or 'Radio Gain' in earlier parlance). It also allows the loudness of a specific sub-collection (an "album") to be consistent with the rest of the collection, while allowing the dynamics from song to song on the album to remain intact. This is called 'Album Gain' (or 'Audiophile Gain' in earlier parlance). This is especially important when listening to classical music albums, because quiet tracks need to remain a certain degree quieter than the louder ones.<br />
<br />
ReplayGain is different from [[Normalization|peak normalization]]. Peak normalization merely ensures that the peak amplitude reaches a certain level. This does not ensure equal loudness. The ReplayGain technique measures the ''effective power'' of the waveform (i.e. the RMS power after applying an "equal loudness contour"), and then adjusts the amplitude of the waveform accordingly. The result is that Replay Gained waveforms are usually more uniformly amplified than peak-normalized waveforms.<br />
<br />
==Target loudness==<br />
The target loudness of almost all ReplayGain utilities is 89 dB SPL (an early departure from the proposal, endorsed by its author<ref>[http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=83397&view=findpost&p=721854 Does Replay gain work differtly in Media monkey]</ref>) &mdash; the ReplayGain proposal and SMPTE recommendation are 6dB lower.<ref>[http://www.mars.org/mailman/public/mad-dev/2004-February/000993.html ReplayGain discussion at mad-dev]</ref><br />
<br />
==Clipping==<br />
Audio is generally recorded such that the loudest sounds don't clip, but the use of ReplayGain can cause clipping if the average volume of a song is below the target level. That is, upon playback, the volume of a quiet song is increased, so the parts of the song with above-average loudness, especially in the bass frequencies, will exceed the limits of the format and will be distorted. Whether this distortion is audible depends on the sounds in question, and the listener's sensitivity.<br />
<br />
Implementations deal with the risk of clipping in different ways. Some have a "pre-amp" feature which reduces (or boosts) the original audio's level by a certain amount before doing whatever is needed for ReplayGain. Some have a "prevent clipping" feature to reduce the amount of ReplayGain adjustment to whatever amount would keep clipping from occurring, based on peak info stored in the file's metadata (thus reducing the effectiveness of ReplayGain). Some recommend using a compressor/limiter DSP to prevent or reduce clipping, regardless of whether it was caused by ReplayGain.<br />
<br />
== Implementations ==<br />
There are different ReplayGain implementations, each with its own uses and strength. Most use [[metadata]] to indicate the level of the volume change that the player should make. Some modify the audio data itself, and optionally use metadata as well. There are advantages and disadvantages to both methods.<br />
<br />
In the metadata method, information on both types of ReplayGain (Track Gain and Album Gain) can be stored. The volume-change information can be very precise. If audio data was also changed, the metadata can contain "undo" info. Not all audio players/decoders know how to read and use ReplayGain information stored in metadata. And there's no standard for where and how ReplayGain info is stored; each implementation uses different formats and puts the info in different locations.<br />
<br />
In the audio data method, the file's actual audio data is modified so that its natural/default playback volume is at the target level. In this scenario, only one type of ReplayGain (Track Gain or Album Gain) can be applied. If no "undo" info is saved somewhere, it may not be possible to restore the original audio data. Limitations of the audio file format may prevent precise (finely tuned) gain adjustments with this method. For example, MP3 and AAC files can only be losslessly modified in 1.5 dB steps. Depending on the audio file format, the process may also be lossy in the sense that it could irreversibly push a signal above the format's maximum amplitude (resulting in clipping) or below the minimum (resulting in silence).<br />
<br />
=== MP3Gain ===<br />
[[MP3Gain]] is an implementation of ReplayGain. It can be used to just analyze files & recommend changes or to also modify the gain. If modifying the gain, it always modifies the global gain fields in the MP3 audio data. It can add somewhat precise metadata, including undo info. The gain can be modified to any target dB, or it can be changed by a specified amount. For balance correction, user-specified changes can even be made on just one channel in simple L/R stereo-mode files (not joint stereo).<br />
<br />
* Format: [[MP3]]<br />
* Method: Audio + Meta (in APE tag), or Audio only<br />
* APE tag fields (ASCII bytes):<br />
** <code>MP3GAIN_MINMAX ###,###</code> - minimum & maximum global gain values for this file. 3 digits, zero-padded if necessary.<br />
** <code>MP3GAIN_ALBUM_MINMAX ###,###</code> - minimum & maximum global gain values across a set of files scanned as an album. Optional.<br />
** <code>MP3GAIN_UNDO +###,+###,N</code> - the global gain adjustment to restore the original values in the left and right channels, respectively, followed by an indicator of whether to wrap at the extremes (<code>N</code> means no, <code>W</code> means yes). The adjustment values are 3 digits, zero-padded, preceded by a sign (<code>+</code> or <code>-</code>).<br />
** <code>REPLAYGAIN_TRACK_GAIN +#.###### dB</code> - The value is always 9 characters including the sign and decimal point. Examples: <code>+0.424046</code> and <code>-10.38500</code><br />
** <code>REPLAYGAIN_TRACK_PEAK #.###### dB</code> - The value is always 8 characters including the decimal point. Example: <code>0.149923</code><br />
** <code>REPLAYGAIN_ALBUM_GAIN +#.###### dB</code> - The value is always 9 characters including the sign and decimal point. Optional.<br />
** <code>REPLAYGAIN_ALBUM_PEAK #.###### dB</code> - The value is always 8 characters including the decimal point. Optional.<br />
* Limitations: Although the metadata, if written, contains precise adjustment & peak values, the audio data modifications are limited to 1.5dB steps and may become irreversible (however, that's a very rare condition; see the [http://www.hydrogenaudio.org/forums/lofiversion/index.php/t34154.html "mp3gain is NOT lossless" forum thread])<br />
* http://mp3gain.sourceforge.net/<br />
<br />
=== AACGain ===<br />
[[AACGain]] is a modified version of MP3Gain that works on both MP3 and AAC files.<br />
<br />
* Format: [[MP3]], [[AAC]] (with or without MP4 container)<br />
* Method: Audio + Meta, or Audio only<br />
* Limitations: Limited to 1.5dB steps mode, may become irreversible (same caveat as for MP3Gain)<br />
* http://aacgain.altosdesign.com/<br />
<br />
=== [[LAME]] ===<br />
* Method: Header ([http://gabriel.mp3-tech.org/mp3infotag.html mp3infotag])<br />
* Notes:<br />
** Tags added during encoding; not supported by any player yet; Track Gain only<br />
** Replay Gaining MP3's are usually done using MP3Gain (see [[ReplayGain#MP3Gain|above]]) or [[ReplayGain#foobar2000 ReplayGain scanner|foobar2000]]<br />
* http://lame.sourceforge.net/<br />
<br />
=== [[Musepack]] ReplayGain ===<br />
* Method: Header (similar to Meta data method)<br />
* Notes: ReplayGain values are stored in the header and ReplayGain is part of the Musepack specifications; therefore any Musepack decoder that does not support ReplayGain can be considered broken.<br />
* http://www.musepack.net/<br />
<br />
=== VorbisGain ===<br />
* Format: (Ogg) [[Vorbis]]<br />
* Method: Meta (in [[Vorbis comment]])<br />
* http://www.sjeng.org/vorbisgain.html<br />
** new compiles of VorbisGain at [http://www.rarewares.org/ogg.html www.rarewares.org]<br />
:'''''Note:''' Andavari has provided a very useful script to integrate VorbisGain, which is a CLI tool, into Windows Explorer. Please (Ogg) [[Vorbis#Replay Gain|check this section]].<br />
<br />
=== FLAC / METAFLAC ===<br />
* Format: [[Free Lossless Audio Codec|FLAC]]<br />
* Method: Meta (in [[Vorbis comment]])<br />
* http://flac.sf.net<br />
<br />
=== WavPack / WVGAIN ===<br />
* Format: [[WavPack]]<br />
* Method: Meta (in [[APEv2]] tag)<br />
* http://www.wavpack.com<br />
<br />
=== Wavegain ===<br />
* Format: waveform<br />
* Method: Audio<br />
* Limitations: Irreversible<br />
* http://www.rarewares.org/others.php#wavegain<br />
<br />
=== MusicPlayer ===<br />
* Custom implementation, not derived from the original MP3Gain one (but inspired from). As far as I know, all other implementations are directly derived from the MP3Gain (gain_analysis.c, which is GPL) source.<br />
* Format: any that FFmpeg supports<br />
* Method: Audio<br />
* Limitations: Doesn't modify the files at all. Stores the value in own database. Used only for playback.<br />
* https://github.com/albertz/music-player<br />
<br />
=== [[foobar2000]] ReplayGain scanner ===<br />
* Format:<br />
** [[MP3]]: Values written to [[ID3v2]] (default) or [[APEv2]] tags. A separate function can be invoked to apply the tagged Track or Album Gain to the MP3 global gain fields (as MP3Gain does, but requiring tags first), and if already tagged, to rewrite the tags to account for the peak change and compensate for the difference from 89&nbsp;dB. The 89&nbsp;dB reference level for tags isn't configurable, but the reference level applied to the global gain fields is (it's under Preferences > Advanced > Tools > ReplayGain Scanner > Target MP3 alteration volume level).<br />
** [[Musepack]]: Values written to header.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WavPack]]: Values written to [[APEv2]] tags.<br />
** [[AAC]]: Values written to [[APEv2]] tags. As with MP3, it is also an option to apply gain via a separate function.<br />
** [[MP4]]: Uses its own iTunes-compatible tagging system (though iTunes does not support ReplayGain).<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** Modules ([[MOD]] etc.): Optionally saved into [[APEv2]] tags.<br />
* http://foobar2000.org<br />
<br />
=== [[MediaMonkey]] ===<br />
* Format:<br />
** [[MP3]]: Values written to [[APEv2]] or [[ID3v2]] tags.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WMA]]: Values stored in MediaMonkey's MDB database.<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** [[WAV]]: Values stored in MediaMonkey's MDB database.<br />
** [[MPC]]: Internal gain Structure.<br />
* In addition to tags, all ReplayGain values are also stored in MediaMonkey's MDB database<br />
* Album/Audiophile ReplayGain not supported until v3.0 (Dec 2007); support during burning & ripping added in 3.1 (Jun 2009)<br />
* Also capable of (irreversibly) changing the volume of MP3 tracks, similar to [[MP3Gain]]<br />
* http://www.mediamonkey.com/<br />
<br />
=== [[Winamp]] ReplayGain scanner===<br />
* Format:<br />
** [[MP3]]: Values written to [[ID3v2]] tags.<br />
** (Ogg) [[Vorbis]]: Values written to [[Vorbis comment]].<br />
** [[WMA]]: Values stored in Windows Media Audio tags.<br />
** [[Free Lossless Audio Codec|FLAC]]: Values written to [[Vorbis comment]].<br />
** [[APE]]: Values written to [[APEv2]] tags.<br />
** [[AAC]]: Values written to [[APEv2]] tags.<br />
** [[MP4]]<br />
** [[TAK]]: Values written to [[APEv2]] tags.<br />
* Support Album/Track Gain<br />
<br />
== Players support ==<br />
ReplayGain being present in the specs of FLAC, Musepack, and APE formats, any player that support those formats usually support ReplayGain.<br />
<br />
The situation with MP3 is rather different, as it was not part of the MP3 specs. The APEv2 tags metadata implementation is somewhat becoming the de-facto standard.<br />
<br />
=== Windows ===<br />
* [[foobar2000]] supports ReplayGain in all possible aspects.<br />
* [[Winamp]] supports ReplayGain in album or track mode.<br />
* [[MediaMonkey]] supports ReplayGain, with many configuration options.<br />
* [[XMPlay]] recently implemented ReplayGain<br />
<br />
''...and probably others.''<br />
<br />
=== Linux ===<br />
* [[XMMS]]. Reads ReplayGain from [[Free Lossless Audio Codec|FLAC]], [[Musepack]], (Ogg) [[Vorbis]] ..<br />
:For [[MP3]], use the CVS version of the [http://xmms-mad.sourceforge.net/ xmms-mad] mp3 plugin (it's not yet released as binary, furthermore not available in distribs' versions for now. Meanwhile binaries are available here: [http://perso.crans.org/~krempp/xmms-mad/ custom binaries])<br />
* [[amarok]]. By using the amarok-script [http://kde-apps.org/content/show.php?content=26073 ReplayGain]<br />
:And possibly others, since [http://developer.kde.org/~wheeler/taglib.html TagLib] added support for [[APEv2]] tags in [[MP3]] files, players using this library (like [[amaroK]] and [[JuK]]) might support that kind of ReplayGain tags in the near future.<br />
* [http://www.sacredchao.net/quodlibet Quod Libet] reads ReplayGain from (Ogg) [[Vorbis]], [[MP3]], [[Free Lossless Audio Codec|FLAC]], and [[Musepack]].<br />
:Requires support to be enabled (via the appropriate python bindings and libraries) for the above formats. Does not support ReplayGain values stored in [[APEv2]] tags in [[MP3]]s. ReplayGain values are stored in RVA2 id3v2.4 frames. See the [http://www.sacredchao.net/quodlibet/wiki/Development/ID3Notes Quod Libet RVA2 / ReplayGain notes].<br />
* [http://www.musicpd.org/ Music Player Daemon] (MPD) reads ReplayGain from (Ogg) [[Vorbis]], [[Free Lossless Audio Codec|FLAC]], and [[Musepack]].<br />
:foobar2000-style TXXX frames in [[MP3]]s are also supported in the latest development releases.<br />
* [http://www.mplayerhq.hu/ MPlayer]. Mplayer support for ReplayGain is codec dependent.<br />
:Codecs that are known to support ReplayGain: vorbis<br />
:Because of this, you need to prioritize the codecs that support it, or choose it individually on the command line. To add it to the command line, add an -ac [codec] option after each file that you want to choose the codec for, or at the beginning to make it apply to all files listed. To prioritize the codecs by default, list them in a line in mplayer.conf:<br />
ac=[codec],[othercodec],vorbis,mad,<br />
<br />
=== Portable devices ===<br />
[http://www.rockbox.org/ Rockbox] supports ReplayGain (in album or track mode) for most formats, including WMA, MP1/2/3, AAC, ALAC, Musepack, Monkey's Audio, Wavpack, FLAC and Vorbis. <br>Note that ReplayGain is only supported when using the respective codec's native tagging format. For example: ReplayGain stored in APEv2 tags is not supported for MP3, rather ID3v2.x tags are expected.<br />
<br />
Sandisk Sansa Fuze with firmware 1.02.26 and 2.02.26<br />
<br />
Sandisk Sansa Clip+<br />
<br />
The iPod features ''Soundcheck'', which seems to produce roughly the same normalization gains as ReplayGain, but doesn't provide an Album Gain.<br />
<br />
=== Hi-Fi ===<br />
Slim Devices a company owned by Logitech Inc, supports ReplayGain on both of their hi-end audiophile players, known as the [[Slim Devices Transporter|Transporter]] and the [[Slim Devices Squeezebox|Squeezebox]].<br />
<br />
==Notes==<br />
<small><references/></small><br />
<br />
== See also ==<br />
* [[ReplayGain specification]]<br />
<br />
== External links ==<br />
* [http://en.wikipedia.org/wiki/Replay_Gain ReplayGain] at Wikipedia<br />
* [http://www.replaygain.org/ ReplayGain - A Proposed Standard], the original proposal, now out of date with respect to current practice<br />
* [http://www.bobulous.org.uk/misc/Replay-Gain.html ReplayGain using foobar2000] (how to use ReplayGain in Windows using foobar2000).<br />
* [http://www.bobulous.org.uk/misc/Replay-Gain-in-Linux.html ReplayGain in Linux] (how to use ReplayGain in Linux using foobar2000 and Wine, or using metaflac or vorbisgain).<br />
<br />
<br />
[[Category:Technical]]<br />
[[Category:Metadata]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Comparison_of_CD_rippersComparison of CD rippers2014-10-25T22:19:09Z<p>Mjb: +Easy Audio Copy</p>
<hr />
<div>On the Hydrogenaudio forums (e.g. [http://www.hydrogenaudio.org/forums/index.php?showtopic=37313&hl= here] and [http://www.hydrogenaudio.org/forums/index.php?showtopic=80863&hl= here]) there have been many discussions and questions about the differences between different Digital Audio Extraction (DAE) software packages (CD rippers). New rippers with secure ripping facilities have emerged in recent years, and it is now difficult to judge compared to some years ago when the only answer was [[Exact Audio Copy]] (EAC).<br />
<br />
==Comparison chart==<br />
<br />
{| cellspacing="2" style="text-align:center; border:1px solid blue;"<br />
|width="200px"|'''Features'''<br />
| width="95px" style="background: #00FFFF" | [[Exact Audio Copy|Exact Audio Copy (EAC)]]<br />
| width="95px" style="background: #00FFFF" | [[dBpoweramp|dBpoweramp CD Ripper]]<br />
| width="95px" style="background: #00FFFF" | [[Foobar2000:Foobar2000|foobar2000]]<br />
| width="95px" style="background: #00FFFF" | [[iTunes]]<br />
| width="95px" style="background: #00FFFF" | [[Windows Media Player]]<br />
| width="95px" style="background: #00FFFF" | [http://www.cuetools.net/wiki/CUERipper CUERipper]<br />
| width="95px" style="background: #00FFFF" | [[XLD]]<br />
| width="95px" style="background: #00FFFF" | [http://sbooth.org/Rip/ Rip]<br />
| width="95px" style="background: #00FFFF" | [[MusicBee]]<br />
| width="95px" style="background: #00FFFF" | [http://perfectrip.cdfreaks.com/ PerfectRip]<br />
| width="95px" style="background: #00FFFF" | [http://www.slysoft.com/en/clonecd.html CloneCD]<br />
| width="95px" style="background: #00FFFF" | [[Cdparanoia]]{{ref|Cdparanoia_fronts|a}}<br />
| width="95px" style="background: #00FFFF" | [http://www.easyaudiocopy.com/ Easy Audio Copy]<br />
|-<br />
!colspan="14" style="background: #ececec"| Data acquisition<br />
|-<br />
| align="left" style="background: #FFFF99" | One track per file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Image as single file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | binary<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | [[Cue sheet|CUE sheet]] generation<br />
| style="background: #00FF00" | yes{{ref|EAC-cue|b}}<br />
| style="background: #CCFFCC" | [http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=82483&view=findpost&p=715699 limited], more [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|EAC-noncompliant|c}}<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
| align="left" style="background: #FFFF99" | gap detection<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | [http://forum.dbpoweramp.com/showthread.php?t=20303 in beta]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes{{ref|ccd|h}}<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes{{ref|Easy-cue|j}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Offset correction<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #CCFFCC" | limited{{ref|prOC|f}}<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[HTOA]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | C2 pointers<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | initial pass, on re-reads<br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #00FF00" | initial pass, on re-reads <br />
| style="background: #CCFFCC" | initial pass<br />
| style="background: #CCFFCC" | limited{{ref|prC2|g}}<br />
| style="background: #00FF00" | initial pass, on re-reads{{ref|ccdc2|i}}<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
|align="left" style="background: #FFFF99" | Defeat cache<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading, FUA<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFCC99" | no<br />
| style="background: #FFCC99" | no<br />
| style="background: #00FF00" | over-reading<br />
| style="background: #FFFFFF" | ?<br />
|-<br />
!colspan="14" style="background: #ececec"| Additional features<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
|align="left" style="background: #FFFF99" | [[AccurateRip]] checking across pressings/offsets<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FFFFFF" | n/a<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | [http://db.cuetools.net/about.php CUEtools db]<br />
| style="background: #00FF00" | [http://db.cuetools.net/plugin.php plugin]<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
|-<br />
| align="left" style="background: #FFFF99" | log file<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Metadata<br />
| style="background: #00FF00" | [[freedb]],{{ref|EAC-ctdb-meta|e}} [[MusicBrainz]],{{ref|EAC-ctdb-meta|e}} [[Discogs]],{{ref|EAC-ctdb-meta|e}} [[CD-Text]]<br />
| style="background: #00FF00" | freedb, MusicBrainz, AMG, GD3, SonataDB, CD-Text, [http://www.dbpoweramp.com/cd-ripper.htm PerfectMeta™]{{ref|compare_meta|d}}<br />
| style="background: #00FF00" | freedb, MusicBrainz ([http://www.hydrogenaudio.org/forums/index.php?showtopic=70623 plugin]), Discogs ([http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 plugin]), CD-Text<br />
| style="background: #00FF00" | gracenote, MusicBrainz (Mac-only [http://musicbrainz.org/doc/FreeDB_Gateway hack]), CD-Text<br />
| style="background: #00FF00" | AMG, CD-Text ([http://bmproductions.fixnum.org/index.htm?http://bmproductions.fixnum.org/moreprogs/wmpcdtext.htm plugin])<br />
| style="background: #00FF00" | freedb, MusicBrainz, Discogs<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz<br />
| style="background: #00FF00" | freedb, MusicBrainz, CD-Text<br />
| style="background: #00FF00" | freedb, CD-Text<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | GD3, others{{ref|Easy-meta|k}}<br />
|-<br />
|align="left" style="background: #FFFF99" | Download Album Art<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | [http://www.hydrogenaudio.org/forums/index.php?showtopic=50523 foo_discogs]<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #00FF00" | yes<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | yes<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #FF9900" | no<br />
| style="background: #00FF00" | yes<br />
|-<br />
| align="left" style="background: #FFFF99" | Cost<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then $38<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (21 days), then €32.60&ndash;55.00<br />
| style="background: #00FF00" | free<br />
| style="background: #CCFFCC" | free (14 days), then $29.90<br />
|-<br />
| align="left" style="background: #FFFF99" | License<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #00FF00" | GPL<br />
| style="background: #FFFFFF" | ?<br />
| style="background: #00FF00" | proprietary, freeware<br />
| style="background: #00FF00" | freeware<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
| style="background: #00FF00" | GPL<br />
| style="background: #CCFFCC" | proprietary, shareware<br />
|-<br />
|align="left" style="background: #FFFF99" | OS<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Windows, Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Mac<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #CCFFCC" | Windows<br />
| style="background: #00FF00" | Mac OS&nbsp;X, Linux/BSD, Windows via Cygwin{{ref|Cdparanoia_fronts|a}}<br />
| style="background: #CCFFCC" | Windows<br />
|}<br />
'''Notes:'''<br />
<br />
*{{note|Cdparanoia_fronts|a}} Cdparanoia, a console application for Unix-like OSes, is one of many frontends to the Paranoia library, libparanoia. Additional OSes and features not directly related to the ripping process might be supported in other frontends. See [[Cdparanoia]] for details.<br />
*{{note|EAC-cue|b}} A number of [[EAC and Cue Sheets|different types CUE sheet types]] are available. Flags are read from TOC only, not subcode.<br />
*{{note|EAC-noncompliant|c}} The EAC-style [[EAC_and_Cue_Sheets#Multiple_WAV_Files_With_Gaps_.28Noncompliant.29_-_a.k.a._.22Append_Gaps_to_.28end_of.29_Previous_Track_.28default.29.22|"Multiple WAV Files With Gaps (Noncompliant)"]] type will be used in single track mode.<br />
*{{note|compare_meta|d}} dBpoweramp is unique in being able to compare metadata from several sources automatically to eliminate erroneous data.<br />
*{{note|EAC-ctdb-meta|e}} In EAC, freedb access can be direct (via the legacy built-in engine), via the bundled freedb plug-in, or via the bundled CTDB plug-in. MusicBrainz access can be via the bundled CTDB plug-in, or via the freedb options with the [http://musicbrainz.org/doc/FreeDB_Gateway MusicBrainz-to-freedb gateway]. Discogs access is via the bundled CTDB plug-in only.<br />
*{{note|prOC|f}} In PerfectRip, offset correction only works if the drive supports overreading.<br />
*{{note|prC2|g}} PerfectRip uses C2 pointers to know where errors are, but it does not re-read; it just flags the rip as "not perfect". However, it does write the C2 pointers to a file which can be used by a separate program to interpolate bad samples.<br />
*{{note|ccdgap|h}} In CloneCD, gaps and indexes are detected only if "Read SubChannel Data from Audio Tracks" is enabled in the Audio CD profile.<br />
*{{note|ccdc2|i}} CloneCD doesn't thoroughly explain its options or re-reading strategy. The disc type profiles allow setting Audio Extraction Quality(Bad/Medium/Good/Best), Fast Error Skip (Off/On/Automatic), Intelligent Bad Sector Scanner (enabled/disabled). The CD Reader (drive) configuration allows setting the number of Read Retries (0-15) and Error Correction (None/Software/Hardware). The effect of each of these options is undocumented, but seems to suggest C2 pointers are used.<br />
*{{note|Easy-cue|j}} Easy Audio Copy offers image extraction and cue sheet generation, including gap detection, only when this functionality is enabled via an advanced settings app, downloadable separately (see [http://www.easyaudiocopy.com/faq.htm the FAQ]).<br />
*{{note|Easy-meta|k}} Easy Audio Copy's website says CD information is obtained from "various internet sites (for example, from the GD³ database)."<br />
<br />
==Explanation of features==<br />
===One track per file===<br />
A standard feature of rippers is the ability to rip each audio track to a separate file.<br />
<br />
===Image as single file===<br />
Some rippers can rip all the audio tracks to a single "image" file, either audio (WAV or AIFF) or raw binary (.bin file containing raw LPCM). The image file normally doesn't include data tracks from Enhanced CDs. This feature can be useful when combined with cue sheets.<br />
<br />
===Cue sheet generation===<br />
Cue sheet generation means the ripper can create a cue sheet to preserve, at a minimum, the relationship between extracted audio and the disc layout (e.g., a list of how an image file is to be split back up into tracks). It usually also indicates the ability to read at least some of the following info from the CD subcode for inclusion in the cue sheet: disc catalog number, track ISRC codes, track indexes (including gaps), disc & track CD-Text data, and track flags. Depending on the ripper, copyright & [[Pre-emphasis|pre-emphasis]] flags might only be taken from the TOC, and CD-Text data might only be filled in with metadata from external sources.<br />
<br />
A "no" or "limited" in this row shouldn't be considered serious unless you're seeking to preserve as much info as possible, aside from the audio data.<br />
<br />
===Gap detection===<br />
Some rippers can read the disc's subcode to find each track's index 00 portion, i.e. the "gap" or "pre-gap", if one exists. Once detected, this info can be used to control whether & how these portions of the tracks are extracted, and the info can be written to a cue sheet so it can be written to a new CD later. Gap detection only refers to scanning for index 00, regardless of whether it contains silence or audible sound.<br />
<br />
A "no" in this row is minor, unless, for example, you're 1. ripping a CD-R that was burned with pure-silence gaps that you want to remove, or 2. planning to burn a copy from the extracted audio (plus accompanying cue sheet) and you want the display on a regular CD player to count up from a negative number to 0:00 between certain tracks, just as it did on the original CD.<br />
<br />
The ability to scan for other index points in the subcode is a related feature not yet covered by this table, and may be connected to other features like cue sheet generation. For example, EAC always scans the subcode for gaps and 02-and-higher index points when generating a cue sheet or when doing an index-based rip. Similarly, a ripper might have the option to scan for 01-index points (track boundaries) in the subcode rather than relying on the TOC, which is sometimes deliberately incorrect or unreadable on some drives, as a copy-protection measure.<br />
<br />
===Offset correction===<br />
The ability of a ripper to compensate for a CD drive's inherent read offset, with sample-level precision, very slightly affects the accuracy of track boundaries, and plays a role in whether & how the fraction of a second of audio at the very beginning or very end of a disc is read. Properly configured rippers which correct for read offsets will produce consistent track boundaries, given the same discs to rip, thus allowing comparisons of ripped audio data made on different drives, e.g. via AccurateRip.<br />
<br />
A "no" in this row should only be cause for concern if you need to be sure track boundaries aren't very slightly off from how they were encoded on the disc.<br />
<br />
===HTOA===<br />
This indicates the ability to read data in the portion of the disc where [[HTOA|Hidden Track One Audio (HTOA)]] may be located, if the drive also supports it. This is the index 00 portion of track 01, and if it exists at all, normally only contains a tiny amount of silence. If it does have non-silent audio, then to hear it, you would have to start playing track 1, then scan backward.<br />
<br />
Very few CDs have HTOA, and not all drives support reading it, so a "no" in this row shouldn't be considered serious unless you're sure you need to read such CDs.<br />
<br />
===C2 pointers===<br />
This row indicates whether & how the ripper makes use of C2 pointers, which are info the drive provides about read errors that the drive detected but wasn't able to correct on its own.<br />
* "None" means C2 pointers are ignored.<br />
* "Initial pass" means that during the first read of a sector, a C2 pointer results in the data being considered bad. This will prompt re-reads or flagging of the data as bad, depending on the ripper and its configuration.<br />
* "On re-reads" means that the same check is done during re-reads, as well.<br />
<br />
===Defeat cache===<br />
This row indicates whether & how the ripper works around the automatic data caching that occurs in some drives. Overreading is a brute-force, slow method where extra data is read in order to flush the cache. Force Unit Access (FUA) is a more efficient method that is only supported in some drives. If you don't have a drive that caches during DAE, this row may not be of interest to you.<br />
<br />
===AccurateRip===<br />
This row indicates whether the ripper can check the AccurateRip database to see if other people got the same audio data when ripping tracks from the same CD. A "no" is nothing to worry about; any rip can be checked against AccurateRip later, using [[CUETools]].<br />
<br />
===AccurateRip checking across pressings/offsets===<br />
Rips of visually identical CDs can have identical audio data, but offset slightly (shifted by a fraction of a second in one direction or the other), for various reasons. For rippers that do check AccurateRip, a "yes" in this row indicates that AccurateRip will be checked for these slightly offset rips, thus increasing the chance of finding a match, if not also increasing the confidence of the rip's accuracy. A "no" indicates that only exact matches for the pressing are checked for.<br />
<br />
===CUETools db===<br />
The CUETools Database (CTDB) is similar to AccurateRip, but it's for whole-CD rips only (not separate tracks) and has cross-pressing support built-in. It also stores recovery data from believed-good rips, so that a bad rip can be corrected with CUETools. A "yes" in this row indicates the ripper can check for matching rips in CTDB and report whether a bad rip might be correctable. "Plugin" indicates support is provided through an optional component.<br />
<br />
===log file===<br />
This row indicates whether the ripper can generate a log file to document the ripping process, such as the ripper version and how it was configured, what data was checked for on the disc, any problems encountered, checksums, AccurateRip lookup results, etc.<br />
<br />
===Metadata===<br />
This row indicates whether and which metadata sources the ripper can use to get basic info about the CD (artist and title for the disc and each track, mainly). Most rippers use this info for naming and tagging files. Some include it in cue sheets, as if it were CD-TEXT.<br />
<br />
===Download Album Art===<br />
For rippers which tag files, this row indicates whether album art images are included in the metadata lookup capabilities. Some rippers only support album art via an optional component.<br />
<br />
===Cost===<br />
This row describes the pricing for a single-user license for the ripper.<br />
<br />
===License===<br />
This row describes the ripper's end-user licensing. "GPL" is a standard [http://www.gnu.org/licenses/gpl.html GNU Public License], which, among other things, implies the source code is open-source. "Proprietary" means a custom license and usually means the source code is private. "Freeware" means the license does not require that users pay for the software. "Shareware" means that payment is required, usually after a free trial period.<br />
<br />
===OS===<br />
This row indicates which operating systems the ripper natively works on.<br />
<br />
<br />
[[Category:Comparison of CD ripping techniques]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Talk:LAMETalk:LAME2014-10-12T14:04:30Z<p>Mjb: /* LAME 4.0a14 */ mystery solved. the "4.0 alpha" builds that surfaced in 2003-2005 are unofficial, alternate versions of 3.92, for testing ideas that may end up in 4.0</p>
<hr />
<div>{{talkheader}}<br />
<br />
==Forum discussions (old)==<br />
This article began as a "List of recommended settings" post in the HA forum. Rather than updating the posts there, the information is now only updated here in the wiki. To reduce confusion, recommendations applicable to old versions of LAME are not kept in the wiki.<br />
<br />
Here are links to some of the old recommendations and other posts of historical interest:<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=32288&st=0&p=327262&#entry327262 Recommended settings for LAME 3.90.x]<br />
* [http://www.hydrogenaudio.org/forums/index.php?act=ST&f=15&t=203 Discussion of the recommended settings for LAME 3.89 to 3.97]<br />
* [http://www.hydrogenaud.io/forums/index.php?act=ST&f=16&t=32288 Further discussion of recommended settings for LAME 3.95 to 3.97]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=18091 VBR -V n settings and presets for LAME 3.95.1]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=90464 Discussion that led to removing a "quality vs. file size" graph]<br />
<br />
==Page discussion==<br />
I propose a major merging with this page. I don't think information about lame should be scattered all over the wiki. I'll think about it this evening and after the merge I'll add a redirect from all Lame related pages to this one.--[[User:Beto|Beto]] 15:51, 13 September 2006 (CDT)<br />
<br />
Finally I ended the revision :)--[[User:Beto|Beto]] 19:14, 14 September 2006 (CDT)<br />
<br />
== LAME compiles Win32 ==<br />
<br />
http://rarewares.org/dancer/dancer.php?f=1 is linked at this Wiki page. But at http://rarewares.org/mp3.html I can only find http://rarewares.org/dancer/dancer.php?f=107 The two archives contain different lame.exe and lame_enc.dll. Why is that? Here's another compile: http://mitiok.maresweb.org/ This is confusing! --[[User:Pohli|Pohli]] 13:16, 27 September 2006 (CDT)<br />
<br />
:IMO we should '''not''' give direct link to the downloader; everytime a new build is outed, the direct link becomes outdated. Better to link only to Rareware's MP3 page. --[[User:Pepoluan|pepoluan]] <small>'''([[User_talk:pepoluan|talk]] | [[Special:Contributions/pepoluan|contribs]])'''</small> 13:46, 27 September 2006 (CDT)<br />
:Agree. If noone oposes we should make the change.--[[User:Beto|Beto]] <small>'''([[User_talk:Beto|talk]] | [[Special:Contributions/Beto|contribs]])'''</small> 15:48, 27 September 2006 (CDT)<br />
:PLUS, LAME binaries are illegal in many countries. It's easy to use google. {{User:Elliottmobile/sig2}} 02:10, 28 September 2006 (CDT)<br />
<br />
This issue was resolved in October 2006. Since then, the wiki only recommends and links to the builds at Rarewares. —[[User:Mjb|Mjb]] ([[User talk:Mjb|talk]]) 00:21, 11 September 2014 (BST)<br />
<br />
== LAME 4.0a14 ==<br />
<br />
There are versions of LAME numbered beyond 3.100 that have been published: most notably, 4.0a6 and 4.0a14. 4.0a14 apparently was released on June 28, 2005, so it is actually quite old - NOT a newer version than 3.100.<br />
It might be worth noting this on the LAME page so that no one gets confused. [[Special:Contributions/98.240.142.9|98.240.142.9]] 05:25, 8 October 2014 (BST)<br />
:Thanks for pointing this out. I looked into it by digging through old forum posts and looking at the code in CVS.<br />
:The "4.0 alpha" builds that surfaced in 2003-2005 are based on one developer's experimental code branch that started in 2002. He was very unhappy that builds of this code were being distributed online by random people who thought it was official LAME 4.0 code.<br />
:If you were to build a working copy of LAME with code from his branch, as some people apparently did, the binary will indeed say it is LAME 4.0 alpha (4.0a1 through 4.0a14, depending on what snapshot you use). However, this doesn't mean it ''is'' the official LAME 4.0 code. It's just a semi-private, alternate version of 3.92, and is one of many such branches in the CVS repository. Official releases are only snapshots of the trunk (the "MAIN" branch).<br />
:The "4.0" name was chosen just to keep it from being confused with the trunk's official 3.93 alphas, and to reflect the fact that the branch is a testing ground for ideas of optimizations and architectural changes that ''may'' go into LAME 4.0 whenever they decide to start work on it in the trunk.<br />
:I attempted to add this info to the History section of the article. Hopefully it's phrased well enough. —[[User:Mjb|Mjb]] ([[User talk:Mjb|talk]]) 15:04, 12 October 2014 (BST)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2014-10-12T13:18:49Z<p>Mjb: /* History */ as requested on the talk page, an explanation of the unofficial LAME 4.0 alpha releases</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
LAME source code is maintained in a CVS repository, and the only official codebase for public use is the trunk code tagged "MAIN". There are also numerous experimental branches of this code in which the developers test new ideas. One of these branches was started after the release of LAME 3.92 in 2002. To keep it from being confused with LAME 3.93 alpha versions, the code was made to self-identify as LAME 4.0 alpha 1 (in late 2002) through 4.0 alpha 14 (since 2005). This code is mainly for the developers to test optimizations and architectural changes in LAME's foundational code, ideas that may eventually be used in the main branch if and when development actually begins on LAME 4.0. However, some members of the public used this code to build working copies of "LAME 4.0" alpha versions in 2003-2005. These should not be considered actual LAME 4.0 releases and the developers do not want public feedback on them, nor do they want any more public builds to be made from this branch.<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with other settings will have no effect on the quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest.<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 4em; vertical-align: bottom" | [[LAME_Y_SWITCH|Y Switch]] !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset extreme</code> || style="text-align: right" | ~240 || style="text-align: center" | 220–260 || || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~220 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~170 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset medium</code> || style="text-align: right" | ~160 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~120 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 15115 Hz – 15648 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | 14581 Hz – 14968 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~80 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | 12516 Hz – 12903 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~70 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | 9336 Hz – 9602 Hz || style="text-align: right" | 24000 Hz<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code><br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Myths_(Vinyl)Myths (Vinyl)2014-10-08T04:36:57Z<p>Mjb: + my attempt to address the assumption that spiky waveforms and higher DR measurements mean different masters were used and that the vinyl is audibly more dynamic</p>
<hr />
<div>==Myth: Vinyl always sounds better than CD==<br />
As described below, despite decades of arguments, '''there is no technical proof of the sonic superiority of the vinyl medium compared to CD.''' One vinyl record may sound better than its equivalent CD for extremely specific reasons. That does not mean the medium as a whole is superior.<br />
<br />
Many people do prefer listening to music on vinyl rather than on CD or digital formats. Many of those reasons have nothing to do with actual sound quality, and have more to do with the tactile characteristics of vinyl - its "feel" - like larger artwork and its required playback ritual. Others prefer listening to CDs for a different set of reasons. There is nothing wrong with preferring vinyl to CDs, as long as the preference is honestly stated on emotional terms, or is precisely quantified and tied to subjective experience, and not obscured with (fallacious) technical appeals.<br />
<br />
==Myth: Vinyl requires a better-sounding master because it is physically incapable of reproducing the hypercompressed sound mastered to CD==<br />
Different masters can substantially improve or reduce sound quality. Some have less background noise. Some alter the dynamic range. There are other mastering techniques that can also affect the sound.<br />
<br />
There are documented instances of different masters being used on vinyl releases compared to CD releases. One notable example is The White Stripes' ''Icky Thump''. However, there are also instances of the same masters being used on vinyl releases compared to CD releases. In fact, if you purchase an album produced in the last two decades on vinyl, it is likely that the master will be no different than the one used on CD. Alternative masters for vinyl cost money, and mastering is a significant cost of producing a record. The reason for different masters is that producers possibly view digital media (like CD) and analog media (like Vinyl) to be different in nature, so they might produce a different master for each medium. Some even believe that Vinyl will automatically yield a superior sound, despite the well known technical limitations and disadvantages compared to the CD.<br />
<br />
'''The technical details behind this myth are as follows.''' The cutting heads used for creating the vinyl lacquer (or metal mother) are speaker-like electromechanical devices driven by an extremely powerful amplifier (several hundred watts). At extremely large/fast cutting head excursions, the cutting head coils may physically burn up, much like how a speaker's voice coils may be destroyed by an excessive current. Also, the diamond cutting head stylus may prematurely wear or break. This places important constraints on the maximum levels that can be recorded to a record.<br />
<br />
A very high power output is required to cut grooves with a high acceleration. Acceleration at the same signal amplitude is higher for higher-frequency signals. Heavily clipped and limited CDs in the modern mastering style have more high-frequency content than earlier masters. In general, increasing the perceived volume of a record - whether by increasing the recording level or by limiting/clipping/compression - raises the cutting head average power.<br />
<br />
Additionally, during playback, the turntable's stylus has limits on what grooves it can successfully track. Cartridges can only track grooves of a finite modulation width (measured in microns) that decreases in frequency. For instance, a cartridge may only be able to track a 300 µm-wide groove at 300 Hz, and yet only 50 µm at 20 kHz. This also places limits on the acceleration and velocity limits the record master can take.<br />
<br />
The most obvious way to work around these issues is simply to reduce the recording level of the vinyl master. That's exactly what vinyl mastering houses do, using multiband limiters that dynamically reduce the treble content of the master, to limit the cutting head power usage.<br />
<br />
===Effect of vinyl mastering on dynamic range===<br />
A related myth is that when vinyl has a higher dynamic range than CD, it means the audio was sourced from a different, more dynamic master, and that the difference in dynamics will be audible.<br />
<br />
It is true that recordings on vinyl sometimes have a spikier waveform and a measurably higher dynamic range than their counterparts on CD, at least when the dynamic range is reported by crude "DR meter" tools that compare peak and RMS levels. The higher "DR value" could indeed be a result of entirely different master recordings being provided to the mastering engineers for each format, or different choices made by the engineers, as happens every time old music is remastered for a new release.<br />
<br />
But even when the same source master is used, the audio is normally further processed when mastering for the target format (be it CD or vinyl), and this often results in vinyl having a spikier waveform and higher DR measurement. There are two types of processing during vinyl mastering that can increase the DR measurements and waveform spikiness, thus reducing the RMS and increasing the basic DR measurement by perhaps several dB:<br />
* The audio is subjected to lowpass or all-pass filtering, which can result in broad peaks becoming slanted ramps.<br />
* The amount and stereo separation of deep bass content is reduced for vinyl, to keep the stylus from being thrown out of the groove.<br />
It is quite possible that these changes are entirely inaudible, despite their effect on the waveform shape and DR measurement.<br />
<br />
The dynamic range of the waveform is also affected by the vinyl playback system; different systems provide different frequency responses. Factors include cartridge, tonearm, preamp, and even the connecting cables. A vinyl rip with weak bass may well have a higher reported DR value than a rip of the same vinyl on equipment with a stronger bass response.<br />
<br />
==Myth: The vinyl surface is heated to several hundred degrees on playback, and repeat play of the same track should wait at least several hours until the vinyl has cooled==<br />
<br />
Professional estimates for the stylus surface temperature during playback are 300-500 °F. Obviously, the temperature of the record is at or close to room temperature except at the stylus contact point - otherwise the record would completely melt. Back-to-back playback will introduce slightly more distortion than a fresh play. This is believed to be a temporary effect and goes away after approx. 10 minutes.<br />
<br />
Repeated playback (no matter what the timeframe) carries the risk of permanent damage. Obviously, records are observed to wear out with repeated play. No published evidence exists of back-to-back playback causing any more permanent damage than if repeated plays are separated by any longer period of time.<br />
<br />
==Myth: Proper vinyl playback is click-free==<br />
<br />
Pops and clicks are often not audible during a song on a well-maintained record and should not distract from the listening experience. No evidence exists of a record that is shown to be played back with absolutely no pops or clicks whatsoever. They are introduced at virtually every stage of production, from cutting the lacquer to the pressing to the playback itself. Some pops and ticks are pressed into the record itself.<br />
<br />
Some pops and ticks result from static discharges during playback. However, this may be mitigated by the use of topical treatments on the record.<br />
<br />
Because of the lack of evidence for a tick-free record and the engineering factors making such a record extremely rare, it is quite likely that no record exists that is truly free from all pops and ticks.<br />
<br />
==Myth: Vinyl is better than CD because it reproduces higher frequencies than CD and avoids anti-aliasing filter issues at the frequencies CDs can reproduce==<br />
<br />
The recording/tracking ability of vinyl is easily at least 50 kHz and perhaps as high as 100 kHz. The most notable proof of this is the CD4 quadraphonic system which relied on a 45 kHz bandwidth to be accurately reproduced. That said, the high-frequency response accuracy of vinyl varies tremendously. Amplitude deviations of 5-10 dB or greater are not uncommon in the 20 kHz range for many records.<br />
<br />
More discussion: http://www.hydrogenaudio.org/forums/index.php?showtopic=98178<br />
<br />
Playback of ultrasound frequencies is still not guaranteed. Many MM cartridges have resonant peaks defined by the preamp loading, or stylus tip resonances defined by the cantilever, that attenuate high-frequency content.<br />
<br />
When groove wear does occur, it occurs much faster at high frequencies than at low frequencies. For modern styli this is not as much of a concern, though.<br />
<br />
There are rarely, if ever, any ultrasonic frequencies for vinyl to preserve. In audio recordings, such frequencies, when present, are normally low-energy noise imparted by electrical equipment and storage media used during recording, mixing, and mastering. Although some musical instruments can produce low-energy overtones in the ultrasonic range, they could only be on the vinyl if every piece of equipment and storage medium in the recording, mixing, and mastering stages was able to preserve them—which is unlikely even in modern recordings, since the average microphone or mixing console is designed only with audible frequencies in mind. Even if the overtones were preserved all the way to the mastering stage, mono and stereo lacquer cutting equipment typically includes a lowpass filter to avoid overheating the cutting head with ultrasonic frequencies.<br />
<br />
Finally, on top of all of these issues, there is simply no scientific evidence that frequencies beyond the 22 kHz limit of CD audio are audible to any known group of people, or that such frequencies affect anyone's perception of the audible range. There is no evidence that reconstruction and anti-aliasing issues are audible.<br />
<br />
==Myth: Vinyl is better than digital because the analog signal on the vinyl tracks the analog signal exactly, while digital is quantized into steps==<br />
<br />
This pervasive myth is based on an incomplete understanding of how digital sampling actually works.<br />
<br />
It is true that analog formats do not have a measurable time or signal resolution, while PCM encoding (used on CDs and DVD-A) records audio data in a quantized format: each sample is taken at evenly spaced steps in time, and embodies amplitude as a step on a finite logarithmic scale.<br />
<br />
However, the Nyquist-Shannon sampling theorem states that continuous-time (analog) signals and their corresponding discrete-time (digital) signals are mathematically equivalent representations of any bandwidth-limited signal, provided the sample rate is higher than 2X the bandwidth. All relevant advantages and disadvantages result from implementation details rather than analog versus digital signal representation method, per se.<br />
<br />
Implementation details and other considerations follow.<br />
<br />
===Frequency resolution===<br />
<br />
The most significant impact of finite sample rate is finite bandwidth. The sample rate determines the Nyquist frequency, the maximum frequency the digital signal can represent.<br />
<br />
Vinyl enthusiasts often imagine that the shape of the waveform between the points where samples are taken is relevant, but the only thing that can exist 'between the samples' is content above the Nyquist frequency. At a CD's 44.1 KHz sample rate, the shape of the waveform between the samples is only accounting for the frequency content above 22.05 KHz, which will only ever be rare supersonic signal components and random noise. Both are deliberately filtered out in vinyl and CD recordings.<br />
<br />
Similarly, PCM is sometimes characterized as producing a jagged, "stair-step" waveform. This is only partially correct; internally, analog-to-digital conversion (ADC) does indeed use a sample-and-hold circuit to measure an approximate, average amplitude across the duration of the sample, and digital-to-analog conversion (DAC) does the same kind of thing, generating a rectangular-ish waveform. However, this output is ''always'' then subjected to additional filtering to smooth it out. Effectively, the ADC output sample values are interpreted as a series of ''points'' intersected by the waveform; the DAC output is a smooth curve, not a stair-step at all. Additionally, modern ADC and DAC chips are engineered to reduce below the threshold of audibility, if not completely eliminate, any other sources of noise in this conversion process, resulting in an extremely high correlation between the input and output signals. (Perhaps a better explanation: [http://xiph.org/video/vid2.shtml xiph.org's "Digital Show & Tell" video])<br />
<br />
A related myth is that components of the signal near the Nyquist frequency must be square waves on CD (or digital media), and that vinyl (or any analog media) preserves pure sine waves. The premise is false. A square wave, or any wave that's not a perfect sine wave, is the sum of multiple pure tones (sine waves), by definition. So if you have a pure 22.05 KHz signal on CD (i.e., sample values +''n'', -''n'', repeatedly), the ADC may first construct a square wave, but it then filters out everything above the Nyquist, leaving behind a sine wave. The principle is the same even in complex waveforms. The end result is that the uppermost frequency components on CD are no closer to being square waves than they are on vinyl.<br />
<br />
===Jitter===<br />
<br />
Another impact of finite sample rate is the possibility of jitter in the sample clock. If the clock is not exactly on time, the jitter causes distortion, sometimes called "jitter error". Jitter error is unique to digital, and is vanishingly miniscule, a tribute to the many years of effort that went into minimizing it. By the time the earliest CD players came out, distortion produced by jitter was well below the threshold of audibility.<br />
<br />
Since it does not use discrete timing steps, analog gear does not have jitter, per se, but wow and flutter—large and small speed variations—occur in all analog gear. The scale of wow and flutter is far greater than that of digital jitter, and is far more likely to produce audible effects.<br />
<br />
===Time resolution===<br />
<br />
PCM can encode time delays to any arbitrarily small length. Time delays of 1&micro;s or less—a tiny fraction of the sample rate—are easily achievable. The theoretical minimum delay is 1 nanosecond or less. (Proof [http://www.stevehoffman.tv/forums/showthread.php?t=85436 here].)<br />
<br />
===Dynamic range===<br />
<br />
Another significant impact of finite quantizing resolution is finite dynamic range. As implemented, the bit depth of CD and DVD digital audio formats accommodates a higher dynamic range than vinyl is capable of. The only signal that can exist 'between the bits' of a CD is drowned out by random noise from the vinyl surface grain.<br />
<br />
===Quantization error===<br />
<br />
Another impact of finite quantizing resolution is systematic rounding and truncation error. The process of ignoring anything too small to be measured can lead to distortion of small signal levels if not splitting the difference exactly between quanta. This is the 'quantization distortion' most often referred to. It is another source of error that is unique to digital.<br />
<br />
With a correct implementation using dither, signal quantization (ie 16-bit or 24-bit) only adds wideband noise to the signal, not quantization distortion. If this dither noise is well below the already-present noise floor, it is inaudible.<br />
<br />
Even without dither, quantization noise from conversion to 16 or 24-bit is unlikely to ever be audible against digitally recorded music or dialog, and in analog recordings and on vinyl will be fully buried in the background noise.<br />
<br />
In inexpensive 1-bit converters, quantization can also cause spurious low-magnitude tones. This is yet another error unique to digital. Understanding of spurious tones is limited, but fortunately some techniques of reducing them have been developed, and 1-bit converters are now in widespread use.<br />
<br />
===Vinyl is often sourced from digital anyway===<br />
Since the mid-1970s, vinyl mastering houses have been using digital delay lines (DDLs) instead of analog delays on the signal going to the lathe that cuts the spiral groove. So even in the increasingly unlikely event that 100% of the recording, mixing and mastering was done entirely using analog gear and media, the end of the vinyl mastering process may well have involved a conversion to digital and back.<ref>See http://www.hydrogenaudio.org/forums/index.php?showtopic=105321</ref><br />
<br />
===Further comparisons===<br />
Analog encoding has many measurable and audible faults, potentially including harmonic distortion, noise and intermodulation distortion. These distortions have invariably measured higher than for digital formats, including CD.<br />
<br />
Tracking error is due to the use of analog encoding with a stylus that contacts the medium, manifesting as distortion and possibly also cyclic wow with subsonic noise if the pressing is off center from the spindle hole. Wow, flutter, footsteps and feedback are other errors due to the transport mechanism and transducers used with vinyl. Digital storage has none of these errors.<br />
<br />
In addition to its advantages for audio storage, digital also has advantages for audio production. When a large number of individual audio sources are sampled from source into 24 bits at high sample rate, then digitally processed with effects and mixed into a standard multichannel format, the resulting mix is superior in dynamic range and harmonic distortion to what could be achieved with legacy analog processing and mixing, due to the elimination of thousands of noise-producing and distortion-producing analog components such as potentiometers, resistors, and transistors. Some digital effects such as lossy codec compression to reduce overall bandwidth (thus reducing storage space) without sacrificing psycho-acoustic realism are impossible to implement in analog, and require a digital format anyway.<br />
<br />
Audio DVD or A/V Blu-ray medium is used in order to preserve the fidelity and channel grouping of modern multichannel recordings. Audio CD can also be used for such digital mixes, but at lower dynamic range and sample rate, and with only two discrete channels, with no lossy compression to reduce storage space. A third alternative is to rip to data disc and play back on computer via digital bus to a multichannel home theater receiver or equivalent.<br />
<br />
In any of these preceeding three use cases, digital is superior to analog at both mastering and end-user stages, and represents an advance in the total sound production signal path rather than simply storage improvement.<br />
<br />
==Myth: Vinyl has greater resolution than CD because its dynamic range is higher than for CD at the most audible frequencies==<br />
<br />
The dynamic range of vinyl, when evaluated as the ratio of a peak sinusoidal amplitude to the peak noise density at that sine wave frequency, is somewhere around 80 dB. Under theoretically ideal conditions, this could perhaps improve to 120 dB. The dynamic range of CDs, when evaluated on a frequency-dependent basis and performed with proper dithering and oversampling, is somewhere around 150 dB. Under no legitimate circumstances will the dynamic range of vinyl ever exceed the dynamic range of CD, under any frequency, given the wide performance gap and the physical limitations of vinyl playback. More discussion at [http://www.hydrogenaudio.org/forums/index.php?showtopic=47827&st=0&p=425794&#entry425794 Hydrogenaudio].<br />
<br />
==Myth: Adding a penny to the headshell improves tracking/sound==<br />
The trackability of a cartridge is related to the mechanical parameters of the tonearm and stylus assembly. Adding weight to the headshell, and adjusting the counterweight to compensate, increases the effective mass of the tonearm and reduces its resonant frequency. If the resonant frequency is excessively high (e.g., 15-20 Hz, as measured by a test record), the increased mass may improve trackability by moving the resonance out of the audible range. Otherwise, it will generally only reduce trackability.<br />
<br />
Adding weight to the headshell ''without'' adjusting the counterweight may improve the ability of a severely damaged stylus to track the groove, or the ability of an undamaged stylus to track a record in poor condition, but the excess weight almost certainly damages the record. A stylus in good condition will yield optimum sound with minimal damage to the groove when used within the tracking force range it's designed for. If the sound/trackability improves when exceeding this recommended range, then the record or stylus should be replaced.<br />
<br />
==Myth: A cartridge is permanently damaged and should be replaced if the stylus appears even slightly bent==<br />
Cartridges and styli are hand-built and always have some finite tolerance in their construction. No stylus has a cantilever that is perfectly straight.<br />
<br />
That said, a severely bent stylus can cause azimuth and alignment errors which may be audible. In extreme cases, it can cause record damage. However, the cartridge itself is unlikely to be at fault; only the stylus would need to be replaced.<br />
<br />
In the case of Moving Coil this is not correct. The stylus is part of the unit and the cantilever/stylus assembly cannot be removed. Stylus can be retipped but not just simply replaced like a moving magnet. Its often more costly to retip than to replace. There are cartridges that are indeed perfect (straight) in manufacture using elements that stay straight yet can flex in service.<br />
<br />
==Myth: Belt-driven turntables are better than direct-drive turntables==<br />
<br />
General claims of improved musicality and audio quality of belt drives are subjective and have no scientific basis.<br />
<br />
In the secondhand market, neither type of drive holds its value any better than the other.<br />
<br />
A poorly-built drive of any type will not necessarily fare better than any other.<br />
<br />
There is a common myth that a direct drive will "hunt" for the correct speed and cause audible speed variations. This has no basis in reality.<br />
<br />
In favor of belt drives:<br />
* Belt drives are generally easier and cheaper to implement, improve, and repair than direct drives.<br />
* Since belt drives are cheaper, a belt-driven turntable can come with a more expensive tonearm than a direct-drive turntable in the same price range.<br />
<br />
In favor of direct drives:<br />
* Well-built direct drives can match or outperform well-built belt drives in terms of rumble.<br />
* Well-built direct drives can match or outperform well-built belt drives in terms of speed tolerance.<br />
* Direct drives tend to last a very long time without maintenance; belt drives need new belts on a semi-regular basis.<br />
* Belt drives tend to have noisier motors as compared to direct drives in the same price range.<br />
<br />
==References==<br />
<references/><br />
<br />
(More references and links back to Hydrogenaudio discussion threads are needed. Please help if you can!)<br />
<br />
[[Category:Guides]]<br />
[[Category:Vinyl]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2014-09-10T23:50:32Z<p>Mjb: /* VBR (variable bitrate) settings */ +fractional values as mentioned at http://www.hydrogenaud.io/forums/index.php?s=&showtopic=95965&view=findpost&p=801806</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with other settings will have no effect on the quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest.<br />
<br />
'''Example:''' <code>-V 2</code><br />
<br />
Fractional values are also accepted, with 9.999 being the absolute lowest quality.<br />
<br />
'''Example:''' <code>-V 2.75</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 4em; vertical-align: bottom" | [[LAME_Y_SWITCH|Y Switch]] !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset fast extreme</code> || style="text-align: right" | ~245 || style="text-align: center" | 220–260 || || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~225 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset fast standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~175 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset fast medium</code> || style="text-align: right" | ~165 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~115 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 15115 Hz – 15648 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | 14581 Hz – 14968 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~85 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | 12516 Hz – 12903 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~65 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | 9336 Hz – 9602 Hz || style="text-align: right" | 24000 Hz<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code><br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=LAMELAME2014-09-10T23:46:54Z<p>Mjb: /* External links */ moved most links elsewhere</p>
<hr />
<div>{{Software Infobox<br />
| name = LAME<br />
| logo = [[Image:Lamelogo.png|250px|LAME official logo]]<br />
| screenshot =<br />
| caption = LAME ain't an MP3 encoder<br />
| maintainer = The LAME project<br />
| stable_release = 3.99<br />
| preview_release = 3.100<br />
| operating_system = Windows, Mac OS/X, Linux/BSD<br />
| use = Encoder/Decoder<br />
| license = LGPL<br />
| website = [http://lame.sourceforge.net/ LAME website]<br />
}}{{featured}}<br />
'''LAME''' (Lame Ain't an MP3 Encoder) is the [[Hydrogenaudio]] recommended [[MP3]] encoder. It has been developed by the open-source community since 1998, and has become the highest quality MP3 encoder for most purposes.<br />
<br />
Some benefits of using LAME:<br />
* Highly optimised presets<br />
* Fast encoding<br />
* [[CBR]], [[ABR]] and quality-optimized [[VBR]] encoding methods<br />
* [[Gapless]] playback with LAME-header compliant decoders<br />
* Supported by recommended CD rippers [[Exact Audio Copy]] and [[CDex]]<br />
* Highly tunable<br />
<br />
<!--extra whitespace here to provide a margin for the Table of Contents--><br />
<br />
==History==<br />
LAME development began around mid-1998. Mike Cheng started it as a patch against the 8hz-MP3 encoder sources. After some quality concerns raised by others, he decided to start from scratch based on the dist10 sources.<ref>dist10 is the rudimentary "demonstration" MP3 encoder described in the MPEG-2 standard, ISO/IEC 13818.</ref> That branch (a patch against the reference sources) became LAME 2.0. By the release of LAME 3.81, all dist10 code was removed, making LAME a completely new program, not a mere patch of an existing encoder.<br />
<br />
The project quickly became a team effort. Mike Cheng eventually left leadership and started working on [http://toolame.sourceforge.net/ tooLAME], an [[MP2]] encoder. Mark Taylor became leader and released version 3.0 featuring gpsycho, a new psychoacoustic model developed by him.<br />
<br />
Nowadays LAME is considered the best MP3 encoder at mid & high bitrates, and features the best VBR model among MP3 implementations, mostly thanks to the dedicated work of talented developers Takehiro Tominaga, Naoki Shibata, Darin Morrison, Gabriel Bouvigne, Robert Hegemann, and others. Development is ongoing.<br />
<br />
Although LAME is generally considered to be an encoder, according to the LAME technical FAQ, it's technically not an encoder, but rather is officially just "a development project which uses the open source model to improve MP3 technology." This improved technology is only released in source code form in order to minimize the risk of violating patents. When the source code is compiled and distributed, it ''may'' require a license from Thomson, depending on where and how it's to be used. The LAME project's position is "Source code is considered as speech, which may contain descriptions of patented technology. Descriptions of patents are in the public domain."<br />
<br />
==Recommended encoder compiles and source code==<br />
<br />
Unless noted otherwise, the recommended LAME compile for optimal quality is always the '''latest stable version'''.<br />
<br />
'''Download the latest LAME from these links:'''<br />
* [http://www.rarewares.org/mp3.php RareWares MP3 Page] - Compiles for Win32, Mac OS X universal binary, Linux etc.<br />
* [http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309 LAME source code on SourceForge]<br />
<br />
Avoid using alpha versions of LAME. These versions have "a" in their version string and are usually only for testing changes and new features, and may result in lower quality MP3s. Use them only if you want to help the developers and provide feedback.<br />
<br />
==Recommended encoder settings==<br />
This section describes the [[Hydrogenaudio]] recommended settings to be used with LAME for highest quality MP3 encoding. These settings require LAME 3.98 or later (the latest stable version is recommended).<br />
<br />
<div style="background-color: #F0F0F0; color: black; border: 1px solid black; margin: 1em; padding: 1em 2em 1em 2em;"><br />
====Maximum quality and archiving====<br />
<br />
Maximum quality is achieved when, regardless of listening conditions, you are unable to detect a difference between the MP3 and the original. As demonstrated by blind [[ABX]] tests, LAME-encoded MP3s typically achieve this level of [[transparency]] when encoded with the default settings, at bitrates well below maximum. Encoding with other settings will have no effect on the quality.<br />
<br />
For archiving, only [[lossless]] formats like [[WavPack]], [[FLAC]], etc. are ideal; they will preserve the audio with no changes, sample-for-sample, regardless of encoder settings. In contrast, lossy formats like MP3 are designed to save space by changing the audio in subtle, often imperceptible ways, even at the encoder's maximum settings.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with best file size</font>====<br />
<br />
<code><font style="color:green">-V0</font></code> (~245 kbps), <code><font style="color:green">-V1</font></code> (~225 kbps), <code><font style="color:green">-V2</font></code> (~190 kbps) or <code><font style="color:green">-V3</font></code> (~175 kbps) are recommended.<br />
<br />
These [[VBR]] settings will normally produce [[transparency|transparent]] results. Audible differences between these presets may exist, but are rare.<br />
<br />
====Very high quality: <font style="color:red">HiFi, home, or quiet listening, with maximum file size</font>====<br />
<br />
<code><font style="color:red">-b 320</font></code> is an alternative to the VBR settings above.<br />
<br />
This [[CBR]] mode will maximize the MP3's bitrate and overall file size. The extra space may allow for some parts of the audio to be compressed with fewer sacrifices, but to date, no one has produced ABX test results demonstrating that perceived quality is ever better than the highest VBR profiles described above.<ref>Prior to version 3.99, CBR and VBR modes were encoded differently by LAME. In some unusual problem samples, these differences were sometimes audible, even at very high bitrates. Current versions of LAME encode CBR and VBR with the same psychoacoustic model, so such differences shouldn't arise from normal use.</ref><br />
<br />
====Portable: <font style="color:purple">listening in noisy conditions, lower bitrate, smaller file size</font>====<br />
<br />
<code><font style="color:purple">-V4</font></code> (~165 kbps), <code><font style="color:purple">-V5</font></code> (~130 kbps) or <code><font style="color:purple">-V6</font></code> (~115 kbps) are recommended.<br />
<br />
<code><font style="color:purple">-V6</font></code> produces an "acceptable" quality, while <code><font style="color:purple">-V4</font></code> should be close to perceptual [[transparency]].<br />
<br />
====Very low bitrate, small sizes: <font style="color:blue">eg. for voice, radio, [[mono]] encoding etc.</font>====<br />
<br />
For very low bitrates, up to 100kbps, [[ABR]] is most often the best solution. <br />
Use <code><font style="color:blue">--abr <bitrate></font></code> (e.g. --abr 80).<br />
<br />
'''--preset voice''' is only available in the command line front-end, and is there for compatibility.<br />
It is currently mapped to '''''--abr 56 -mm''''', so that means that the recommendation would be to encode in mono, and use ABR.<br />
</div><br />
<br />
==Understanding the bitrate settings==<br />
MP3s are divided into frames, each frame being a particular size, expressed as a [[bitrate]]. If the bitrate of every frame is the same throughout the file, then the file is considered to be ''constant bit rate'' ([[CBR]]). Otherwise, it is ''variable bit rate'' ([[VBR]]). LAME offers CBR and VBR encoding modes, as well as a special VBR encoding mode called [[ABR]] (''average bit rate'').<br />
<br />
===VBR (variable bitrate) settings===<br />
'''[[VBR]]:''' ''variable bitrate mode. Use variable bitrate modes when the goal is to achieve a fixed level of quality using the lowest possible bitrate.''<br />
<br />
VBR is best used to target a specific quality level, instead of a specific bitrate. The final file size of a VBR encode is less predictable than with [[ABR]], but the quality is usually better.<br />
<br />
Unlike other MP3 encoders which do VBR encoding based on predictions of output quality, LAME's default VBR method tests the ''actual'' output quality to ensure the desired quality level is always achieved.<br />
<br />
'''Usage:''' <code>-V &lt;number></code> where &lt;number> is between 0 and 9, 0 being highest quality, 9 being the lowest.<br />
<br />
'''Example:''' <code>-V2</code> or <code>-V 2</code><br />
<br />
'''Note:''' The switch <code>--vbr-new</code>, which enabled a superior VBR mode in LAME 3.97 and some previous versions, is no longer needed with LAME 3.98 and higher, as it is now the default VBR mode. However, if you're still using LAME 3.97 or older, you have to add <code>--vbr-new</code> to your command line to use that mode.<br />
<br />
The target bitrate and actual typical bitrate for each VBR quality level is shown in the [[#Technical information|Technical details for recommended LAME settings]] section below.<br />
<br />
If you need a predictable bitrate (in a streaming application, for example), use ABR or CBR modes, described below.<br />
<br />
===ABR (average bitrate) settings===<br />
'''[[ABR]]:''' ''average bitrate mode. A compromise between VBR and CBR modes, ABR encoding varies bits around a specified target bitrate.''<br />
<br />
Use ABR when you need to know the final size of the file but still want to allow the encoder some flexibility to decide which passages need more bits. The output is an ordinary VBR file compatible with all MP3 players that support VBR; ABR is not a special type of file, just a LAME-specific strategy for producing VBR.<br />
<br />
'''Usage:''' <code>--preset &lt;bitrate></code> where &lt;bitrate> (desired averaged bitrate in kbit/s) is a value between 8 and 320.<br />
<br />
'''Example:''' <code>--preset 200</code><br />
<br />
'''Important:''' ''ABR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===CBR (constant bitrate) settings===<br />
'''[[CBR]]:''' ''constant bitrate mode. CBR encoding is not efficient. Whereas VBR and ABR modes can supply more bits to complex music passages and save bits on simpler ones, CBR encodes every frame at the same bitrate.''<br />
<br />
CBR is only recommended for usage in streaming situations where the upper bitrate must be strictly enforced. There is still some variability in bitrate behind the scenes, through LAME's use of the [[bit reservoir]] feature of the MP3 format, but it is much less flexible than actual VBR.<br />
<br />
'''Usage:''' <code>-b <bitrate></code> where <bitrate> (bitrate in kbit/s) must be chosen from the following values: 8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, or 320.<br />
<br />
'''Example:''' <code>-b 192</code><br />
<br />
'''Important:''' ''CBR setting is tuned from 320 kbit/s down to 80 kbit/s.''<br />
<br />
===Remarks===<br />
* The rule of thumb when considering encoding options: at a given bitrate, [[VBR]] is higher quality than [[ABR]], which is higher quality than [[CBR]] (VBR > ABR > CBR in terms of quality). However, [[ABX]] tests demonstrate that as bitrate increases, the perceptual differences diminish, with all modes generally reaching [[transparency]] well before their maximum settings; when you can't tell the difference, the modes are qualitatively the same.<br />
<br />
* All modes and settings mentioned in this topic belong to the specifications of the MP3 standard, and the resulting MP3s should be playable by every MP3 decoder that conforms with the standard. If your decoder or device does not play MP3s produced by LAME, blame the manufacturer or developer, not LAME.<br />
<br />
* Prior to LAME 3.98, the <code>--vbr-new</code> switch enabled the new VBR mode. This is now the default VBR mode, with the old mode being available via <code>--vbr-old</code>. In terms of quality, the new mode appears to be better than the old, but reports of artifacts when using the new mode do exist. Despite these possible issues, the new mode is currently recommended due to both the speed and quality increases afforded by the new algorithm.<br />
<br />
==Technical information==<br />
===Recommended settings details===<br />
<br />
{| class="wikitable" style="margin: 1em auto 1em auto;"<br />
|+'''Technical details of the recommended settings'''<br />
! style="vertical-align: bottom" | Switch !! style="vertical-align: bottom" | Preset !! style="width: 4em; vertical-align: bottom" | Target Kbps !! style="width: 4em; vertical-align: bottom" | Typical Kbps<ref>Typical bitrates are mostly based on the results of testing with LAME 3.98.2.</ref> !! style="width: 4em; vertical-align: bottom" | [[LAME_Y_SWITCH|Y Switch]] !! style="vertical-align: bottom" | Lowpass<ref>This range is the transition band of the lowpass filter. Signal components are at full intensity at the lower frequency. Higher frequencies are attenuated on a slope which reaches zero at (and beyond) the high end of the given range. Further info can be found [http://www.hydrogenaud.io/forums/index.php?s=&showtopic=106868&view=findpost&p=874354 in the HA forum].</ref> !! style="vertical-align: bottom" | Resample<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-b 320</code> || <code>--preset insane</code> || style="text-align: right" | 320 || style="text-align: center" | 320 || style="text-align: center" | Y<ref>CBR mode uses <code>-Y</code> in effect; see the [[LAME Y switch]] article.</ref> || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 0</code> || <code>--preset fast extreme</code> || style="text-align: right" | ~245 || style="text-align: center" | 220–260 || || ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 1</code> || || style="text-align: right" | ~225 || style="text-align: center" | 190–250 || || style="text-align: center" | 19383 Hz – 19916 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 2</code> || <code>--preset fast standard</code> || style="text-align: right" | ~190 || style="text-align: center" | 170–210 || || style="text-align: center" | 18671 Hz – 19205 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 3</code> || || style="text-align: right" | ~175 || style="text-align: center" | 150–195 || style="text-align: center" | Y || style="text-align: center" | 17960 Hz – 18494 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 4</code> || <code>--preset fast medium</code> || style="text-align: right" | ~165 || style="text-align: center" | 140–185 || style="text-align: center" | Y || style="text-align: center" | 17249 Hz – 17782 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 5</code> || || style="text-align: right" | ~130 || style="text-align: center" | 120–150 || style="text-align: center" | Y || style="text-align: center" | 16538 Hz – 17071 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 6</code> || || style="text-align: right" | ~115 || style="text-align: center" | 100–130 || style="text-align: center" | Y || style="text-align: center" | 15115 Hz – 15648 Hz ||<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 7</code> || || style="text-align: right" | ~100 || style="text-align: center" | 80–120 || style="text-align: center" | Y || style="text-align: center" | 14581 Hz – 14968 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 8</code> || || style="text-align: right" | ~85 || style="text-align: center" | 70–105 || style="text-align: center" | Y || style="text-align: center" | 12516 Hz – 12903 Hz || style="text-align: right" | 32000 Hz<br />
|-<br />
|- style="background:white;color:black"<br />
| style="text-align: center" | <code>-V 9</code> || || style="text-align: right" | ~65 || style="text-align: center" | 45–85 || style="text-align: center" | Y || style="text-align: center" | 9336 Hz – 9602 Hz || style="text-align: right" | 24000 Hz<br />
|}<br />
<br />
The default lowpass settings were not chosen at random; for general use, they are as high as they can be without putting quality at risk. Raising the the cutoff via command-line options is not recommended. See the [[high-frequency content in MP3s]] article for more info.<br />
<br />
===Fraunhofer decoder incompatibility===<br />
Differing interpretations of an unclear portion of the MP3 spec led to a Windows-specific version of the Fraunhofer IIS MP3 decoder being unable to properly play certain MP3s created with certain versions of LAME.<br />
<br />
In order to demonstrate the problem, the problematic MP3 must have been created with LAME 3.97 or earlier, and must contain a frame with certain parameters and a very large amount of data, such as a 320-kbps frame which makes heavy use of the [[bit reservoir]]. The decoder must be the DirectShow filter <code>l3codecx.ax</code> version 1.5.0 or lower, as used by Windows Media Player on versions of Windows prior to Windows Vista. An [http://support.microsoft.com/kb/2115168/en-us August 2010 security update] for Windows XP and Server 2003 upgraded this filter to version 1.6.0, which can play the problematic MP3s. Windows Vista shipped with the older version but Windows Media Player uses a different filter, and later versions of Windows don't have the old filter at all.<br />
<br />
A workaround was implemented in LAME 3.98.0 beta 1 through LAME 3.98.2, and in LAME 3.99 alpha 1, whereby 320-kbps frames were limited in how much of the bit reservoir they could use. This resulted in wasted space when the bit reservoir would grow beyond the limit. In LAME 3.98.3 and beyond, and in LAME 3.99 alpha 2 and beyond, the method was changed such that the bit reservoir can't grow beyond the limit.<br />
<br />
Related discussion threads:<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=40308 LAME high bitrate files in l3codeca.ax]<br />
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=78114 Lame 3.98 wastes bits]<br />
<br />
===VBR header and LAME tag===<br />
<br />
LAME supports the ''de facto'' standard of adding an extra frame of silence to the beginning of MP3 files. This "VBR header" or "Info tag" provides a home for precise info about the audio duration and a table of seek points. It is mainly for the benefit of players working with VBR files. Decoders usually treat the frame as informational, rather than playing the audio.<br />
<br />
LAME uses the Xing format for this header, and extends it by embedding a 20-byte "LAME tag" with additional info:<br />
* a short version string (9 ASCII bytes; see [[LAME version string]])<br />
* audio and info tag CRCs (since LAME 3.90)<br />
* separate delay & padding values for gapless playback (since LAME 3.90)<br />
* various encoder settings (since LAME 3.90, expanded in 3.94 to include presets)<br />
<br />
Prior to LAME 3.94, the VBR header was only written in VBR files. Since 3.94, it is written to CBR files, too, with "Info" instead of "XING" at the beginning.<br />
<br />
Details are in this wiki's [[MP3#VBRI, XING, and LAME headers|MP3 article]] and [[LAME version string]] article, and in LAME developer Gabriel Bouvigne's [http://gabriel.mp3-tech.org/mp3infotag.html MP3 Info Tag] documentation.<br />
<br />
===Hey! What happened to "--alt-preset"?===<br />
<br />
The revolutionary <code>--alt-preset</code> system was introduced in LAME 3.90. It was replaced by the <code>--preset</code> flags in later versions.<br />
<br />
Starting with version 3.94, the <code>-Vx</code> quality system was introduced, allowing finer control over the desired quality level and bitrate. The <code>--preset</code> switches were made into aliases to the corresponding <code>-V</code> flags for the sake of backward compatibility. '''There is no difference between the output you get if you use <code>-V2</code> or <code>--alt-preset standard</code>.'''<br />
<br />
Recent LAME versions feature more streamlined command-line options, and it's recommended to stick to one of the values described in the text or shown in the table above.<br />
<br />
For example, the following command-line options will all produce the same output:<br />
<br />
* <code>--alt-preset insane</code><br />
* <code>--preset insane</code><br />
* <code>-b 320</code><br />
* <code>--preset 320</code><br />
* <code>--preset cbr 320</code><br />
<br />
==See also==<br />
* [[LAME Y switch|The -Y switch]]<br />
* [[MP3]]<br />
* [[CBR]]<br />
* [[VBR]]<br />
* [[ABR]]<br />
* [[Exact Audio Copy]]<br />
* [[EAC and Lame | Configuring EAC and LAME]]<br />
<br />
==Notes and references==<br />
<references/><br />
<br />
==External links==<br />
* [http://lame.sourceforge.net LAME official homepage]<br />
<!--ReallyRarewares and the rest of rjamorim.com is gone. If the content is back online, please restore & update these links.<br />
*[http://www.rjamorim.com/rrw/lame.html Historical versions of LAME] at ReallyRareWares<br />
--><br />
<br />
[[Category:Software]]<br />
[[Category:Encoder/Decoder]]<br />
[[Category:MP3]]</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Talk:LAMETalk:LAME2014-09-10T23:46:00Z<p>Mjb: /* Forum discussions (old) */ more links, better titles</p>
<hr />
<div>{{talkheader}}<br />
<br />
==Forum discussions (old)==<br />
This article began as a "List of recommended settings" post in the HA forum. Rather than updating the posts there, the information is now only updated here in the wiki. To reduce confusion, recommendations applicable to old versions of LAME are not kept in the wiki.<br />
<br />
Here are links to some of the old recommendations and other posts of historical interest:<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=32288&st=0&p=327262&#entry327262 Recommended settings for LAME 3.90.x]<br />
* [http://www.hydrogenaudio.org/forums/index.php?act=ST&f=15&t=203 Discussion of the recommended settings for LAME 3.89 to 3.97]<br />
* [http://www.hydrogenaud.io/forums/index.php?act=ST&f=16&t=32288 Further discussion of recommended settings for LAME 3.95 to 3.97]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=18091 VBR -V n settings and presets for LAME 3.95.1]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=90464 Discussion that led to removing a "quality vs. file size" graph]<br />
<br />
==Page discussion==<br />
I propose a major merging with this page. I don't think information about lame should be scattered all over the wiki. I'll think about it this evening and after the merge I'll add a redirect from all Lame related pages to this one.--[[User:Beto|Beto]] 15:51, 13 September 2006 (CDT)<br />
<br />
Finally I ended the revision :)--[[User:Beto|Beto]] 19:14, 14 September 2006 (CDT)<br />
<br />
== LAME compiles Win32 ==<br />
<br />
http://rarewares.org/dancer/dancer.php?f=1 is linked at this Wiki page. But at http://rarewares.org/mp3.html I can only find http://rarewares.org/dancer/dancer.php?f=107 The two archives contain different lame.exe and lame_enc.dll. Why is that? Here's another compile: http://mitiok.maresweb.org/ This is confusing! --[[User:Pohli|Pohli]] 13:16, 27 September 2006 (CDT)<br />
<br />
:IMO we should '''not''' give direct link to the downloader; everytime a new build is outed, the direct link becomes outdated. Better to link only to Rareware's MP3 page. --[[User:Pepoluan|pepoluan]] <small>'''([[User_talk:pepoluan|talk]] | [[Special:Contributions/pepoluan|contribs]])'''</small> 13:46, 27 September 2006 (CDT)<br />
:Agree. If noone oposes we should make the change.--[[User:Beto|Beto]] <small>'''([[User_talk:Beto|talk]] | [[Special:Contributions/Beto|contribs]])'''</small> 15:48, 27 September 2006 (CDT)<br />
:PLUS, LAME binaries are illegal in many countries. It's easy to use google. {{User:Elliottmobile/sig2}} 02:10, 28 September 2006 (CDT)<br />
<br />
This issue was resolved in October 2006. Since then, the wiki only recommends and links to the builds at Rarewares. —[[User:Mjb|Mjb]] ([[User talk:Mjb|talk]]) 00:21, 11 September 2014 (BST)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Talk:LAMETalk:LAME2014-09-10T23:21:38Z<p>Mjb: /* LAME compiles Win32 */ added a note that this was resolved long ago</p>
<hr />
<div>{{talkheader}}<br />
<br />
==Forum discussions (old)==<br />
This article began as a "List of recommended settings" post in the HA forum. Rather than updating the posts there, the information is now only updated here in the wiki. To reduce confusion, recommendations applicable to old versions of LAME are not kept in the wiki.<br />
<br />
Here are links to some of the old recommendations and other posts of historical interest:<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=32288&st=0&p=327262&#entry327262 Recommended settings for Lame version 3.90.x] (includes acknowledgements)<br />
* [http://www.hydrogenaudio.org/forums/index.php?act=ST&f=15&t=203 Forum discussion of the recommended settings (older)]<br />
* [http://www.hydrogenaud.io/forums/index.php?showtopic=18091 VBR -V n settings and presets]<br />
<br />
==Page discussion==<br />
I propose a major merging with this page. I don't think information about lame should be scattered all over the wiki. I'll think about it this evening and after the merge I'll add a redirect from all Lame related pages to this one.--[[User:Beto|Beto]] 15:51, 13 September 2006 (CDT)<br />
<br />
Finally I ended the revision :)--[[User:Beto|Beto]] 19:14, 14 September 2006 (CDT)<br />
<br />
== LAME compiles Win32 ==<br />
<br />
http://rarewares.org/dancer/dancer.php?f=1 is linked at this Wiki page. But at http://rarewares.org/mp3.html I can only find http://rarewares.org/dancer/dancer.php?f=107 The two archives contain different lame.exe and lame_enc.dll. Why is that? Here's another compile: http://mitiok.maresweb.org/ This is confusing! --[[User:Pohli|Pohli]] 13:16, 27 September 2006 (CDT)<br />
<br />
:IMO we should '''not''' give direct link to the downloader; everytime a new build is outed, the direct link becomes outdated. Better to link only to Rareware's MP3 page. --[[User:Pepoluan|pepoluan]] <small>'''([[User_talk:pepoluan|talk]] | [[Special:Contributions/pepoluan|contribs]])'''</small> 13:46, 27 September 2006 (CDT)<br />
:Agree. If noone oposes we should make the change.--[[User:Beto|Beto]] <small>'''([[User_talk:Beto|talk]] | [[Special:Contributions/Beto|contribs]])'''</small> 15:48, 27 September 2006 (CDT)<br />
:PLUS, LAME binaries are illegal in many countries. It's easy to use google. {{User:Elliottmobile/sig2}} 02:10, 28 September 2006 (CDT)<br />
<br />
This issue was resolved in October 2006. Since then, the wiki only recommends and links to the builds at Rarewares. —[[User:Mjb|Mjb]] ([[User talk:Mjb|talk]]) 00:21, 11 September 2014 (BST)</div>Mjbhttps://wiki.hydrogenaud.io/index.php?title=Hydrogenaudio_Listening_TestsHydrogenaudio Listening Tests2014-09-10T23:18:45Z<p>Mjb: /* External Tests */ use archive link</p>
<hr />
<div>One of the most visible ways that HydrogenAudio members have shown their enthusiasm for audio quality and their respect for [[TOS 8|scientific principles]] over the years is by organizing and participating in public blind listening tests of lossy codecs and presenting statistical analyses of the results. These results show the advantages and disadvantages of different formats and encoders and help identify which are "state of the art."<br />
<br />
[[Private Listening Tests|Private listening tests]] also provide useful data, but the public HydrogenAudio tests are a rarity in having enough participants to both average out variations among individual listeners and still have statistically significant results.<br />
<br />
Note that a listening test cannot really compare formats or encoder "brands." Instead, it compares particular versions of particular encoders at particular bitrates. Results will differ with different encoders, newer versions of the same encoders, or different bitrates. Use caution when extrapolating, and use the most recent results when extrapolating to the newest encoder versions.<br />
<br />
'''Note:''' There would be no point in listening tests of [[lossless]] encoders; the decoded results are bit-identical to the original uncompressed recordings. [[Lossless comparison|Lossless encoder comparisons]] instead consider technical aspects such as compression ratio and encode/decode speed.<br />
<br />
All tests are sorted by date, newest first. All dates are in [http://www.cl.cam.ac.uk/~mgk25/iso-time.html ISO8601 format].<br />
<br />
==Tests and Results==<br />
{|class="wikitable" align="right"<br />
!colspan=2| Result Symbol Key<br />
|-<br />
| > || Better than<br />
|-<br />
| ~ || About the same as<br />
|-<br />
| ~> || About the same, but slightly better than<br />
|}<br />
<br />
===Multiformat Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#aaffff"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2014-07<br />
| 96-kbps<br>General<br />
| Kamedo2<br />
| [[Apple AAC]] (iTunes 11.2.2), [[Opus]] (1.1),<br>[[Vorbis]] ([[aoTuV]] Beta6.03), [[MP3]] ([[LAME]] 3.99.5)<br />
| In-progress<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=106354 HA Thread]<br>In progress<br />
|-<br />
| 2011-04-10<br />
| 64-kbps<br>General<br />
| IgorC<br />
| [[Vorbis]] [[aoTuV]], [[QuickTime AAC|Quicktime]] HE-[[AAC]], [[Opus]]<br />
| Opus > Apple ><br />Nero ~ Vorbis<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=87785 HA Thread]<br>[http://listening-tests.hydrogenaud.io/igorc/results.html Complete Result]<br />
|-<br />
| 2007-08-16<br />
| 64-kbps<br>General<br />
| Sebastian Mares<br />
| [[Vorbis]] [[aoTuV]], [[Nero AAC]],<br>[[WMA]] Pro<br />
| Nero > WMA Pro ~ Vorbis<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=56397 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-64-1/results.htm Complete Result]<br />
|- <br />
| 2006-11-22<br />
| 48-kbps<br>General<br />
| Sebastian Mares<br />
| [[Vorbis]] [[aoTuV]], [[Nero AAC]],<br>[[WMA]] Pro, [[WMA]] Standard<br />
| Nero > WMA Pro ~ Vorbis > <br /> WMA Standard<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=50408 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-48-1/results.htm Complete Result]<br />
|-<br />
| 2006-01-13<br />
| 128-kbps<br>General<br />
| Sebastian Mares<br />
| [[QuickTime AAC]], [[Nero AAC]], [[LAME]] [[MP3]],<br>[[Vorbis]] [[aoTuV]], [[WMA]] Pro<br />
| 5-way tie<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=40607&view=findpost&p=357117 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mf-128-1/results.htm Complete Result]<br />
|}<br />
<br />
===[[AAC]] Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#ffaaaa"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2011-08-20<br />
| 96-kbps <br>General<br />
| IgorC<br />
| CT, [[Fraunhofer|FhG AAC]] via Winamp (not [[Fraunhofer FDK AAC|FDK]]), [[Nero AAC|Nero]], [[QuickTime AAC|QuickTime]] TVBR & CVBR<br />
| Quicktime CVBR ~> TVBR ~><br /> Fraunhofer > CT > Nero<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=89765 HA Thread]<br>[http://listening-tests.hydrogenaud.io/igorc/aac-96-a/results.html Complete result]<br />
|-<br />
| 2006-02-20<br />
| 48-kbps HE-AAC<br>General<br />
| Gabriel<br />
| 3gpp (v1), CT (v1 & v2), [[Nero AAC|Nero]] (v1 & v2)<br />
| All tie for most sample types;<br /> otherwise any v1 > any v2<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=42679&hl= HA Thread]<br>[http://www.mp3-tech.org/tests/aac_48/results.html Complete Result]<br />
|-<br />
| 2006-02-05<br />
| 48-kbps HE-AAC<br>Classical<br />
| Ivan Dimkovic<br />
| [[Nero AAC|Nero]] HE-AAC v1 & v2<br />
|<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=41191&hl= HA Thread]<br />
|}<br />
<br />
===[[MP3]] Tests===<br />
<br />
{| border="1" cellpadding="2" cellspacing="0" style="text-align:center;"<br />
|- style="background:#aaffaa"<br />
! Date !! Title<br>Samples !! Performed by !! Codecs !! Result !! Links<br />
|-<br />
| 2008-10-17<br />
| 130-kbps<br>General<br />
| Sebastian Mares<br />
| [[LAME]] 3.97, [[LAME]] 3.98.2, [[iTunes]], [[Fraunhofer|FhG MP3]], [[Helix]]<br />
|<br />
| [http://www.hydrogenaud.io/forums/index.php?showtopic=66564 HA Thread]<br>[http://listening-tests.hydrogenaud.io/sebastian/mp3-128-1/results.htm Complete Result]<br />
|}<br />
<br />
==External Tests==<br />
Other people have held listening tests in venues outside of Hydrogenaudio (although the organizers of the tests tend to be HA members :). The results of these tests are found below:<br />
<br />
* [http://web.archive.org/web/20090303211614/http://ff123.net/ ff123's site on audio testing and listening tests] (most recent test 2002-07-27)<br />
* [http://web.archive.org/web/20071014001946/http://www.rjamorim.com/test/ Roberto's Public Listening Tests] (most recent test 2004-07-11)<br />
* [http://listening-tests.hydrogenaud.io/sebastian/ Sebastian Mares' Listening Tests] (most recent test updated 2008-11-22)<br />
* [http://www.soundexpert.info/ SoundExpert Listening Tests] (continually updated)<br />
<br />
<br />
[[Category:Listening Tests]]</div>Mjb