Amarok/Manual/Various/ReplayGain: Difference between revisions

From KDE UserBase Wiki
m (formatting)
(formatting corrections)
 
(10 intermediate revisions by 2 users not shown)
Line 2: Line 2:
<translate>
<translate>


== Replay Gain ==
=== Replay Gain === <!--T:1-->
[https://en.wikipedia.org/wiki/ReplayGain Replay gain] will automatically adjust the volume of the currently played song, relative to other songs, as determined by the person who encoded the audio file. To enable replay gain, see [[Amarok/Manual/References/MenuAndCommandReference/Settings#Settings_Menu|Settings menu]]


To handle this, Amarok relies on metadata embedded in the audio file:
<!--T:2-->
# If no replay gain information is embedded, Amarok will not adjust the volume
[https://en.wikipedia.org/wiki/ReplayGain Replay gain] will automatically adjust the volume of the currently played song, relative to other songs, as determined by the person who encoded the audio file. To enable replay gain, see [[Special:myLanguage/Amarok/Manual/References/MenuAndCommandReference/Settings#Settings_Menu|Settings menu]].
# If replay gain information is found, it will be written into Amarok's database
 
<!--T:3-->
To handle this, '''Amarok''' relies on metadata embedded in the audio file:
 
<!--T:21-->
# If no replay gain information is embedded, '''Amarok''' will not adjust the volume
# If replay gain information is found, it will be written into '''Amarok's''' database
 
<!--T:22-->
During playback, '''Amarok''' will only look into its own database for this information. Updates to the metadata of the file will not always get written into the database during a collection update (e.g. replay gain is deleted from file).
During playback, '''Amarok''' will only look into its own database for this information. Updates to the metadata of the file will not always get written into the database during a collection update (e.g. replay gain is deleted from file).


<!--T:4-->
This can lead to unexpected behavior: Songs from the same artist play at different volume levels etc.
This can lead to unexpected behavior: Songs from the same artist play at different volume levels etc.


=== Is replay gain being used? ===
==== Is replay gain being used? ==== <!--T:5-->
 
<!--T:6-->
To figure out if the volume problem is caused by replay gain or bad encoding:
To figure out if the volume problem is caused by replay gain or bad encoding:
<!--T:7-->
* Disable replay gain processing (see above)
* Disable replay gain processing (see above)
<!--T:8-->
* Start '''Amarok''' in debug mode and search for gain- related output:
* Start '''Amarok''' in debug mode and search for gain- related output:
{{Input|<nowiki>amarok -d --nofork | grep gain</nowiki>}}
{{Input|<nowiki>amarok -d --nofork | grep gain</nowiki>}}
If replay gain is active for the played song, the output will be
If replay gain is active for the played song, the output will be
Using gain of -10.28 with relative peak of -1
{{Output|<nowiki>Using gain of -10.28 with relative peak of -1</nowiki>}}


=== View replay gain information ===
==== View replay gain information ==== <!--T:9-->
 
<!--T:10-->
For .flac files, "metaflac" can be used to view embedded replay gain data:
For .flac files, "metaflac" can be used to view embedded replay gain data:
{{Input|<nowiki>metaflac --list Millencolin\ -\ Balanced\ Boy.flac</nowiki>}}
{{Input|<nowiki>metaflac --list Millencolin\ -\ Balanced\ Boy.flac</nowiki>}}
Among other things, this will show something like this:
Among other things, this will show something like this:
METADATA block #2
{{Output|<nowiki>METADATA block #2
  type: 4 (VORBIS_COMMENT)
type: 4 (VORBIS_COMMENT)
  is last: false
is last: false
  length: 390
length: 390
  vendor string: reference libFLAC 1.2.1 20070917
vendor string: reference libFLAC 1.2.1 20070917
  comments: 14
comments: 14
    comment[9]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
  comment[9]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
    comment[10]: REPLAYGAIN_TRACK_GAIN=-1.55 dB
  comment[10]: REPLAYGAIN_TRACK_GAIN=-1.55 dB
    comment[11]: REPLAYGAIN_TRACK_PEAK=0.75894165
  comment[11]: REPLAYGAIN_TRACK_PEAK=0.75894165
    comment[12]: REPLAYGAIN_ALBUM_GAIN=-4.19 dB
  comment[12]: REPLAYGAIN_ALBUM_GAIN=-4.19 dB
    comment[13]: REPLAYGAIN_ALBUM_PEAK=0.98712158
  comment[13]: REPLAYGAIN_ALBUM_PEAK=0.98712158
</nowiki>}}


To view this tracks information within the Amarok database:
<!--T:11-->
To view this tracks information within the '''Amarok''' database:
{{Input|<nowiki>select id, title, albumgain, albumpeakgain, trackgain, trackpeakgain from tracks where title like "Balanced%";</nowiki>}}
{{Input|<nowiki>select id, title, albumgain, albumpeakgain, trackgain, trackpeakgain from tracks where title like "Balanced%";</nowiki>}}
<!--T:12-->
Will show:
Will show:
+-------+------------------+-----------+---------------+-----------+---------------+
{{Output|<nowiki>
| id    | title            | albumgain | albumpeakgain | trackgain | trackpeakgain |
+-------+------------------+-----------+---------------+-----------+---------------+
+-------+------------------+-----------+---------------+-----------+---------------+
| id    | title            | albumgain | albumpeakgain | trackgain | trackpeakgain |
| 10459 | Balanced Boy    |      0.53 |      -5.60297 |      0.44 |      -5.60297 |
+-------+------------------+-----------+---------------+-----------+---------------+
| 10459 | Balanced Boy    |      0.53 |      -5.60297 |      0.44 |      -5.60297 |
</nowiki>}}


<!--T:13-->
Note the difference in loudness levels
Note the difference in loudness levels


=== Delete replay gain information ===
==== Delete replay gain information ==== <!--T:14-->
 
<!--T:15-->
First, delete the metadata from the file:
First, delete the metadata from the file:
{{Input|<nowiki>metaflac --remove-replay-gain Millencolin\ -\ Balanced\ Boy.flac</nowiki>}}
{{Input|<nowiki>metaflac --remove-replay-gain Millencolin\ -\ Balanced\ Boy.flac</nowiki>}}


<!--T:16-->
After that, update your '''Amarok''' collection. If it is still using replay gain, update the database entry:
After that, update your '''Amarok''' collection. If it is still using replay gain, update the database entry:
{{Input|<nowiki>update tracks set albumgain=-1,albumpeakgain=-1,trackgain=-1,trackpeakgain=-1 where id=10459</nowiki>}}
{{Input|<nowiki>update tracks set albumgain=-1,albumpeakgain=-1,trackgain=-1,trackpeakgain=-1 where id=10459</nowiki>}}


<!--T:17-->
Restart '''Amarok''' and the log output should now show the updated values being used.
Restart '''Amarok''' and the log output should now show the updated values being used.


<!--T:18-->
Feel free to try and mess with the values manually to improve volume levels.
Feel free to try and mess with the values manually to improve volume levels.
<!--T:19-->
{{Prevnext2
| prevpage=Special:myLanguage/Amarok/Manual/Various/Moodbar | nextpage=Special:myLanguage/Amarok/Manual/Various/AmarokOnOtherPlatforms
| prevtext=Moodbar | nexttext=Amarok on Other Platforms
| index=Special:myLanguage/Amarok/Manual | indextext=Back to Menu
}}
<!--T:20-->
[[Category:Amarok2.8]]
[[Category:Multimedia]]
[[Category:Tutorials]]
</translate>
</translate>

Latest revision as of 08:06, 14 July 2018

Other languages:

Replay Gain

Replay gain will automatically adjust the volume of the currently played song, relative to other songs, as determined by the person who encoded the audio file. To enable replay gain, see Settings menu.

To handle this, Amarok relies on metadata embedded in the audio file:

  1. If no replay gain information is embedded, Amarok will not adjust the volume
  2. If replay gain information is found, it will be written into Amarok's database

During playback, Amarok will only look into its own database for this information. Updates to the metadata of the file will not always get written into the database during a collection update (e.g. replay gain is deleted from file).

This can lead to unexpected behavior: Songs from the same artist play at different volume levels etc.

Is replay gain being used?

To figure out if the volume problem is caused by replay gain or bad encoding:

  • Disable replay gain processing (see above)
  • Start Amarok in debug mode and search for gain- related output:
amarok -d --nofork | grep gain

If replay gain is active for the played song, the output will be

Using gain of -10.28 with relative peak of -1

View replay gain information

For .flac files, "metaflac" can be used to view embedded replay gain data:

metaflac --list Millencolin\ -\ Balanced\ Boy.flac

Among other things, this will show something like this:

METADATA block #2
 type: 4 (VORBIS_COMMENT)
 is last: false
 length: 390
 vendor string: reference libFLAC 1.2.1 20070917
 comments: 14
   comment[9]: REPLAYGAIN_REFERENCE_LOUDNESS=89.0 dB
   comment[10]: REPLAYGAIN_TRACK_GAIN=-1.55 dB
   comment[11]: REPLAYGAIN_TRACK_PEAK=0.75894165
   comment[12]: REPLAYGAIN_ALBUM_GAIN=-4.19 dB
   comment[13]: REPLAYGAIN_ALBUM_PEAK=0.98712158

To view this tracks information within the Amarok database:

select id, title, albumgain, albumpeakgain, trackgain, trackpeakgain from tracks where title like "Balanced%";

Will show:

+-------+------------------+-----------+---------------+-----------+---------------+
| id    | title            | albumgain | albumpeakgain | trackgain | trackpeakgain |
+-------+------------------+-----------+---------------+-----------+---------------+
| 10459 | Balanced Boy     |      0.53 |      -5.60297 |      0.44 |      -5.60297 |

Note the difference in loudness levels

Delete replay gain information

First, delete the metadata from the file:

metaflac --remove-replay-gain Millencolin\ -\ Balanced\ Boy.flac

After that, update your Amarok collection. If it is still using replay gain, update the database entry:

update tracks set albumgain=-1,albumpeakgain=-1,trackgain=-1,trackpeakgain=-1 where id=10459

Restart Amarok and the log output should now show the updated values being used.

Feel free to try and mess with the values manually to improve volume levels.