diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2023-12-17 14:43:38 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-01-20 16:08:33 +0000 |
commit | f04727145bf0e7c651e08592360fb22a101d3f43 (patch) | |
tree | 423d48817b5657884b4b805f8c6c1395f32f3fcb /options/options.c | |
parent | 0f2370476b4279040261878c601fb8015a8502d7 (diff) | |
download | mpv-f04727145bf0e7c651e08592360fb22a101d3f43.tar.bz2 mpv-f04727145bf0e7c651e08592360fb22a101d3f43.tar.xz |
audio: add --volume-gain options to control volume in decibels
This adds volume-gain, volume-gain-max, volume-gain-min options, which
can be used to control audio volume and target dynamic range in decibels.
The gain is applied on top of the existing volume setting.
Diffstat (limited to 'options/options.c')
-rw-r--r-- | options/options.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c index fcf2c9f1d0..c94ca891a6 100644 --- a/options/options.c +++ b/options/options.c @@ -705,6 +705,10 @@ static const m_option_t mp_opts[] = { // values <0 for volume and mute are legacy and ignored {"volume", OPT_FLOAT(softvol_volume), .flags = UPDATE_VOL, M_RANGE(-1, 1000)}, + {"volume-gain-max", OPT_FLOAT(softvol_gain_max), M_RANGE(0, 150)}, + {"volume-gain-min", OPT_FLOAT(softvol_gain_min), M_RANGE(-150, 0)}, + {"volume-gain", OPT_FLOAT(softvol_gain), .flags = UPDATE_VOL, + M_RANGE(-150, 150)}, {"mute", OPT_CHOICE(softvol_mute, {"no", 0}, {"auto", 0}, @@ -928,6 +932,9 @@ static const struct MPOpts mp_default_opts = { .msg_color = true, .softvol_max = 130, .softvol_volume = 100, + .softvol_gain_max = 12, + .softvol_gain_min = -96, + .softvol_gain = 0, .gapless_audio = -1, .wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv", .stop_screensaver = 1, |