From 403ed90e2e7bed3e017938d76e17037b0d5059b6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 May 2015 08:35:46 +0000 Subject: replaygain uses the "gain" effect instead of "vol" The `gain' effect seems superior as it can "see" across the effects chain to take into account extra/lost headroom. For example, this allows me to add the the "gain -h" effect at the start of my effects chain before the RGFX placeholder in my source command, so when I play a file requiring a -6dB ReplayGain adjustment, I will only need an additional -4dB of headroom to accomodate the 10dB boost at 20Hz I use (for listening through headphones): Before: RGFX='vol -6dB' sox "$INFILE" $SOXFMT - $TRIMFX $RGFX vol -10dB equalizer 20 0.7071q 10 After: RGFX='gain -6' sox "$INFILE" $SOXFMT - $TRIMFX gain -h $RGFX equalizer 20 0.7071q 10 --- test/test_rg_integration.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/test_rg_integration.rb') diff --git a/test/test_rg_integration.rb b/test/test_rg_integration.rb index f8e81c2..efc8f97 100644 --- a/test/test_rg_integration.rb +++ b/test/test_rg_integration.rb @@ -1,8 +1,10 @@ # Copyright (C) 2013-2015 all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require './test/player_integration' +require 'dtas/util' class TestRgIntegration < Testcase include PlayerIntegration + include DTAS::Util def tmp_pluck(len = 5) pluck = Tempfile.open(%w(pluck .flac)) @@ -58,10 +60,10 @@ class TestRgIntegration < Testcase assert_match expect, cur["current"]["env"]["RGFX"] end - check_gain.call(%r{vol -3dB}, "album_gain") - check_gain.call(%r{vol -2dB}, "track_gain") - check_gain.call(%r{vol 1\.3}, "track_peak") - check_gain.call(%r{vol 1\.0}, "album_peak") + check_gain.call(%r{gain -3}, "album_gain") + check_gain.call(%r{gain -2}, "track_gain") + check_gain.call(%r{gain 0\.0}, "album_peak") + check_gain.call(%r{gain 2\.5}, "track_peak") s.req_ok("rg preamp+=1") rg = YAML.load(yaml = s.req("rg")) -- cgit v1.2.3-24-ge0c7