Difference between revisions of "Loudgain"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
m (Corrected some links to audio file formats)
(Undo revision 35506 by Complexlogic (talk))
 
(14 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
| stable_release      = 0.6.8
 
| stable_release      = 0.6.8
 
| stable_release_date  = 2019-09-06
 
| stable_release_date  = 2019-09-06
| operating_system    = Linux, MacOS
+
| operating_system    = Linux, MacOS, Windows 10
 
| use                  = Tagging
 
| use                  = Tagging
 
| license              = BSD license
 
| license              = BSD license
 +
| website              = [https://github.com/Moonbase59/loudgain/]
 
}}
 
}}
 
'''loudgain''' is an open-source [[ReplayGain 2.0 specification|ReplayGain 2]] tagging tool for Linux, MacOS (via Homebrew) and Windows 10 (via the ''Linux bash''). It analyzes many types of audio files, based on the EBU R128/ITU BS.1170 standard (at -18 LUFS), and uses the well-known [[MP3Gain]] commandline syntax. Loudgain never modifies the audio data, but instead only writes the appropriate ReplayGain tags.
 
'''loudgain''' is an open-source [[ReplayGain 2.0 specification|ReplayGain 2]] tagging tool for Linux, MacOS (via Homebrew) and Windows 10 (via the ''Linux bash''). It analyzes many types of audio files, based on the EBU R128/ITU BS.1170 standard (at -18 LUFS), and uses the well-known [[MP3Gain]] commandline syntax. Loudgain never modifies the audio data, but instead only writes the appropriate ReplayGain tags.
Line 19: Line 20:
  
 
For extra versatility, loudgain also supports writing the ''loudness range'' and ''loudness reference'' values, forcing upper- or lowercase ReplayGain tags, and stripping "foreign" tags from some file types.
 
For extra versatility, loudgain also supports writing the ''loudness range'' and ''loudness reference'' values, forcing upper- or lowercase ReplayGain tags, and stripping "foreign" tags from some file types.
 +
 +
In case of writing [[ID3v2]] tags, these can be specified to be either ''ID3v2.4'' (default) or ''ID3v2.3''. Any neccessary conversions will be done internally (i.e., converting UTF-8 frames to UTF-16 when going from ID3v2.4 to ID3v2.3).
  
 
==Supported file formats==
 
==Supported file formats==
Line 34: Line 37:
 
** [[WavPack]]: Values written to [[APEv2]] tags.
 
** [[WavPack]]: Values written to [[APEv2]] tags.
 
** [[Monkey's Audio]] (APE): Values written to [[APEv2]] tags.
 
** [[Monkey's Audio]] (APE): Values written to [[APEv2]] tags.
 
==Development==
 
loudgain v0.1 was originally developed by Alessandro Ghedini in 2014.
 
 
[[User:Moonbase|Matthias C. Hormann]] forked this version in 2019 and took over the development of loudgain after version 0.1, starting with version 0.2.1.
 
The latest version is '''0.6.8'''.
 
  
 
==Command line help==
 
==Command line help==
Line 72: Line 69:
 
   -S,  --striptags      Strip tag types other than ID3v2 from MP2/MP3.
 
   -S,  --striptags      Strip tag types other than ID3v2 from MP2/MP3.
 
                           Strip tag types other than APEv2 from WavPack/APE.
 
                           Strip tag types other than APEv2 from WavPack/APE.
   -I 3, --id3v2version=3  Write ID3v2.3 tags to MP2/MP3/WAV files.
+
   -I 3, --id3v2version=3  Write ID3v2.3 tags to MP2/MP3/WAV/AIFF.
   -I 4, --id3v2version=4  Write ID3v2.4 tags to MP2/MP3/WAV files (default).
+
   -I 4, --id3v2version=4  Write ID3v2.4 tags to MP2/MP3/WAV/AIFF (default).
  
 
   -o,  --output          Database-friendly tab-delimited list output.
 
   -o,  --output          Database-friendly tab-delimited list output.
Line 81: Line 78:
 
Please report any issues to https://github.com/Moonbase59/loudgain/issues.
 
Please report any issues to https://github.com/Moonbase59/loudgain/issues.
 
</pre>
 
</pre>
 +
 +
==Closer analysis of files==
 +
[[Image:Loudgain-csv.png|thumb|Album data in spreadsheet]]
 +
Using the <code>-O</code> (uppercase letter O) switch, loudgain can produce a detailed tab-separated list, ideal for redirection into a <code>.csv</code> spreadsheet file and later analysis.
 +
 +
Simply use a command like the following and then import the <code>album.csv</code> file into your spreadsheet application, specifying "tab-delimited CSV":
 +
<pre>
 +
loudgain -O [OPTIONS] FILES... > album.csv
 +
</pre>
 +
 +
==loudgain on Windows 10==
 +
[[Image:Loudgain-windows10-bash.png|thumb|loudgain in Windows 10’s ''Linux bash'']]
 +
There is currently no Windows-native version of loudgain, but it can easily be used with Windows 10’s ''Linux bash''.
 +
 +
Detailed installation instructions can be found on [https://github.com/Moonbase59/loudgain#installation-on-windows-10-linux-bash loudgain’s GitHub page].
  
 
==Known problems==
 
==Known problems==
 
* Loudgain relies on standard libraries like ''TagLib''. Linux distros (except rolling releases) sometimes deliver outdated libraries, so '''be sure you use the latest version of ''TagLib''.''' Version 1.11.1 had a nasty bug for a while that [https://hydrogenaud.io/index.php/topic,118085.msg974957.html#msg974957 could corrupt Ogg Vorbis files]. This has been fixed in the meantime but the TagLib version not updated. Loudgain comes with a (slower) static version called <code>loudgain.static</code> in the repo’s <code>/bin</code> folder that doesn’t expose the bug and can also be used on older Linux versions (like Ubuntu 14.04, Linux Mint 17).
 
* Loudgain relies on standard libraries like ''TagLib''. Linux distros (except rolling releases) sometimes deliver outdated libraries, so '''be sure you use the latest version of ''TagLib''.''' Version 1.11.1 had a nasty bug for a while that [https://hydrogenaud.io/index.php/topic,118085.msg974957.html#msg974957 could corrupt Ogg Vorbis files]. This has been fixed in the meantime but the TagLib version not updated. Loudgain comes with a (slower) static version called <code>loudgain.static</code> in the repo’s <code>/bin</code> folder that doesn’t expose the bug and can also be used on older Linux versions (like Ubuntu 14.04, Linux Mint 17).
 +
* ''TagLib'' versions prior to Version 1.12 couldn’t write ''ID3v2.3'' tags to AIFF files. This now works if loudgain is compiled against ''TagLib 1.12 or newer''.
 +
 +
==Development==
 +
loudgain v0.1 was originally developed by Alessandro Ghedini in 2014.
 +
 +
[[User:Moonbase|Matthias C. Hormann]] forked this version in 2019 and took over the development of loudgain after version 0.1, starting with version 0.2.1.
 +
The latest version is '''0.6.8'''.
  
 
==See also==
 
==See also==
Line 93: Line 112:
 
* [https://github.com/Moonbase59/loudgain#technical-details-advanced-users-stuff loudgain technical details on GitHub]
 
* [https://github.com/Moonbase59/loudgain#technical-details-advanced-users-stuff loudgain technical details on GitHub]
 
* [https://github.com/Moonbase59/loudgain/issues loudgain bug tracker]
 
* [https://github.com/Moonbase59/loudgain/issues loudgain bug tracker]
 +
* [https://aur.archlinux.org/packages/loudgain/ loudgain in the ArchLinux User Repository (AUR)]
  
 
[[Category:Software]]
 
[[Category:Software]]

Latest revision as of 13:56, 17 May 2022

loudgain
{{{logo}}}
Loudgain-terminal.png
Loudgain running in a Linux terminal window.
Developer(s) Matthias C. Hormann, Alessandro Ghedini
Release information
Initial release 22 June 2014
Stable release 0.6.8 (September 6, 2019)
Preview release {{{preview_release}}}
Compatibility
Operating system Linux, MacOS, Windows 10
Additional information
Use Tagging
License BSD license
Website [1]

loudgain is an open-source ReplayGain 2 tagging tool for Linux, MacOS (via Homebrew) and Windows 10 (via the Linux bash). It analyzes many types of audio files, based on the EBU R128/ITU BS.1170 standard (at -18 LUFS), and uses the well-known MP3Gain commandline syntax. Loudgain never modifies the audio data, but instead only writes the appropriate ReplayGain tags.

For mass-tagging (assuming one album per folder), loudgain comes with a bash script called rgbpm that can be modified to the user’s needs.

Technical details

Loudgain computes the ReplayGain (volume adjustment), true peak value and loudness range, using the EBU R128 algorithm for each track and (optionally) a whole album. The optional clipping prevention feature can further reduce the computed gain to a level where no clipping should occur (default -1 dBTP). Computed values are then written to the audio files as tags in a suitable tag format.

For extra versatility, loudgain also supports writing the loudness range and loudness reference values, forcing upper- or lowercase ReplayGain tags, and stripping "foreign" tags from some file types.

In case of writing ID3v2 tags, these can be specified to be either ID3v2.4 (default) or ID3v2.3. Any neccessary conversions will be done internally (i.e., converting UTF-8 frames to UTF-16 when going from ID3v2.4 to ID3v2.3).

Supported file formats

  • Supported audio file formats as of version 0.6.8:
    • FLAC: Values written to Vorbis comment.
    • MP2, MP3: Values written to ID3v2 tags (ID3v2.3/ID3v2.4 selectable).
    • (Ogg) Vorbis: Values written to Vorbis comment.
    • (Ogg) FLAC: Values written to Vorbis comment.
    • (Ogg) Speex: Values written to Vorbis comment.
    • Opus: Values written to Vorbis comment, based on -23 LUFS Opus standard. Only R128_TRACK_GAIN and R128_ALBUM_GAIN are written, but the calculated true peak value can still be used to reduce the gain values (Clipping prevention).
    • MP4, M4A: Uses its own iTunes-compatible tagging system (though iTunes does not support ReplayGain). ReplayGain values are stored under ----:com.apple.iTunes:…. This is for AAC and ALAC in MPEG-4 containers.
    • ASF, WMA: Values written to WMA tags, no prefix.
    • WAV: Values written to the ID3 chunk, in ID3v2 (ID3v2.3/ID3v2.4 selectable) format. Using the bext chunk (for BWF v2) isn’t (yet) supported, but won’t be destroyed on writing.
    • AIFF: Values written to the ID3 chunk, in ID3v2 format.
    • WavPack: Values written to APEv2 tags.
    • Monkey's Audio (APE): Values written to APEv2 tags.

Command line help

Usage: loudgain [OPTIONS] FILES...

loudgain 0.6.8 supports writing tags to the following file types:
  FLAC (.flac), Ogg (.ogg, .oga, .spx, .opus), MP2 (.mp2), MP3 (.mp3),
  MP4 (.mp4, .m4a), ASF/WMA (.asf, .wma), WavPack (.wv), APE (.ape).
  Experimental: WAV (.wav), AIFF (.aiff, .aif).

Options:
  -h,   --help            Show this help.
  -v,   --version         Show version number.

  -r,   --track           Calculate track gain only (default).
  -a,   --album           Calculate album gain (and track gain).

  -c,   --clip            Ignore clipping warning.
  -k,   --noclip          Lower track/album gain to avoid clipping (<= -1 dBTP).
  -K n, --maxtpl=n        Avoid clipping; max. true peak level = n dBTP.
  -d n, --pregain=n       Apply n dB/LU pre-gain value (-5 for -23 LUFS target).

  -s d, --tagmode=d       Delete ReplayGain tags from files.
  -s i, --tagmode=i       Write ReplayGain 2.0 tags to files.
  -s e, --tagmode=e       like '-s i', plus extra tags (reference, ranges).
  -s l, --tagmode=l       like '-s e', but LU units instead of dB.
  -s s, --tagmode=s       Don't write ReplayGain tags (default).

  -L,   --lowercase       Force lowercase tags (MP2/MP3/MP4/WMA/WAV/AIFF).
                          This is non-standard but sometimes needed.
  -S,   --striptags       Strip tag types other than ID3v2 from MP2/MP3.
                          Strip tag types other than APEv2 from WavPack/APE.
  -I 3, --id3v2version=3  Write ID3v2.3 tags to MP2/MP3/WAV/AIFF.
  -I 4, --id3v2version=4  Write ID3v2.4 tags to MP2/MP3/WAV/AIFF (default).

  -o,   --output          Database-friendly tab-delimited list output.
  -O,   --output-new      New format tab-delimited list output.
  -q,   --quiet           Don't print scanning status messages.

Please report any issues to https://github.com/Moonbase59/loudgain/issues.

Closer analysis of files

Album data in spreadsheet

Using the -O (uppercase letter O) switch, loudgain can produce a detailed tab-separated list, ideal for redirection into a .csv spreadsheet file and later analysis.

Simply use a command like the following and then import the album.csv file into your spreadsheet application, specifying "tab-delimited CSV":

loudgain -O [OPTIONS] FILES... > album.csv

loudgain on Windows 10

loudgain in Windows 10’s Linux bash

There is currently no Windows-native version of loudgain, but it can easily be used with Windows 10’s Linux bash.

Detailed installation instructions can be found on loudgain’s GitHub page.

Known problems

  • Loudgain relies on standard libraries like TagLib. Linux distros (except rolling releases) sometimes deliver outdated libraries, so be sure you use the latest version of TagLib. Version 1.11.1 had a nasty bug for a while that could corrupt Ogg Vorbis files. This has been fixed in the meantime but the TagLib version not updated. Loudgain comes with a (slower) static version called loudgain.static in the repo’s /bin folder that doesn’t expose the bug and can also be used on older Linux versions (like Ubuntu 14.04, Linux Mint 17).
  • TagLib versions prior to Version 1.12 couldn’t write ID3v2.3 tags to AIFF files. This now works if loudgain is compiled against TagLib 1.12 or newer.

Development

loudgain v0.1 was originally developed by Alessandro Ghedini in 2014.

Matthias C. Hormann forked this version in 2019 and took over the development of loudgain after version 0.1, starting with version 0.2.1. The latest version is 0.6.8.

See also

External links