Commit: df1258c4aa2f62347fffa7766aef7bb79c933968
Parent: 329162d1171358a8b4c0b93ca50ef9a2065802de
Author: Ren Tatsumoto
Date: Fri, 30 Oct 2020 06:30:50 +0300
add a config option to control coupling of volumes
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -145,6 +145,9 @@ autoclip=no
# Remove all spaces from the subtitle text.
# Only makes sense for languages without spaces like Japanese.
nuke_spaces=yes
+# if set to `yes`, the volume of the outputted audio file
+# depends on the volume of the player at the time of export
+tie_volumes=no
# Images
snapshot_format=webp
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -53,6 +53,7 @@ local config = {
image_field = "Image",
menu_font_size = 25,
note_tag = "subs2srs",
+ tie_volumes = false, -- if set to true, the volume of the outputted audio file depends on the volume of the player at the time of export
}
local utils = require('mp.utils')
@@ -527,7 +528,7 @@ encoder.create_audio = function(start_timestamp, end_timestamp, filename)
table.concat { '--start=', start_timestamp },
table.concat { '--end=', end_timestamp },
table.concat { '--aid=', mp.get_property("aid") }, -- track number
- table.concat { '--volume=', mp.get_property('volume') },
+ table.concat { '--volume=', config.tie_volumes and mp.get_property('volume') or '100' },
table.concat { '--oacopts-add=b=', config.audio_bitrate },
table.concat { '-o=', fragment_path }
)