From 3338a0cf6087b981702227734af7817e97498a8e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 1 Dec 2013 06:36:56 +0000 Subject: splitfx: support --no-dither/-D option splitfx is incapable of knowing in 100% of cases whether dithering should be used (as it has no visibility into sox internals), so support disabling it completely via command-line. This is like the identical sox option, and passed to sox(1), too. This feature is useful for splitting already-mastered 16-bit recordings. --- lib/dtas/splitfx.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 6f1654e..2a0b9de 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -173,7 +173,11 @@ class DTAS::SplitFX # :nodoc: end # add noise-shaped dither for 16-bit (sox manual seems to recommend this) - outfmt.bits && outfmt.bits <= 16 and env["DITHERFX"] = "dither -s" + if opts[:no_dither] + env["SOX_OPTS"] = "#{ENV["SOX_OPTS"]} -D" + else outfmt.bits && outfmt.bits <= 16 + env["DITHERFX"] = "dither -s" + end comments = Tempfile.new(%W(dtas-splitfx-#{t.comments["TRACKNUMBER"]} .txt)) comments.sync = true t.comments.each do |k,v| -- cgit v1.2.3-24-ge0c7