diff options
-rw-r--r-- | Documentation/dtas-splitfx.txt | 4 | ||||
-rwxr-xr-x | bin/dtas-splitfx | 1 | ||||
-rw-r--r-- | lib/dtas/splitfx.rb | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/Documentation/dtas-splitfx.txt b/Documentation/dtas-splitfx.txt index 2367aba..49e55dc 100644 --- a/Documentation/dtas-splitfx.txt +++ b/Documentation/dtas-splitfx.txt @@ -31,6 +31,10 @@ to use ecasound(1), too. -s, \--quiet, \--silent : Silent operation, commands are not printed as executed +-D, \--no-dither +: Disable automatic setting of the DITHERFX env. This also passes + the option to sox(1) via SOX_OPTS. + # FILE FORMAT * infile - string, the pathname of the original audio file diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx index d75c1de..6e98aba 100755 --- a/bin/dtas-splitfx +++ b/bin/dtas-splitfx @@ -13,6 +13,7 @@ OptionParser.new('', 24, ' ') do |op| op.on('-n', '--dry-run') { opts[:dryrun] = true } op.on('-j', '--jobs [JOBS]', Integer) { |val| opts[:jobs] = val } op.on('-s', '--quiet', '--silent') { |val| opts[:silent] = true } + op.on('-D', '--no-dither') { |val| opts[:no_dither] = true } op.parse!(ARGV) end 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| |