From e6a2ff2a3984320b1b83f5051709880a8b9d3708 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 May 2015 10:12:34 +0000 Subject: splitfx: --bits and --rate for quick-n-dirty generic targets generic targets (e.g. "wav") is useful for quickly checking if clipping is introduced by dither and resampling, so we'll support changing the sample rate and bits-per-sample from the command-line so users don't need to setup their own targets or wait on FLAC encoding. --- lib/dtas/splitfx.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/dtas') diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index 5b04854..a14d221 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -57,6 +57,8 @@ class DTAS::SplitFX # :nodoc: @infile = nil @outdir = nil @compression = nil + @rate = nil + @bits = nil @targets = { "flac-cdda" => { "command" => CMD, @@ -157,6 +159,8 @@ class DTAS::SplitFX # :nodoc: def generic_target(target = "flac") outfmt = @infmt.dup outfmt.type = target + outfmt.bits = @bits if @bits + outfmt.rate = @rate if @rate { "command" => CMD, "format" => outfmt } end @@ -333,6 +337,8 @@ class DTAS::SplitFX # :nodoc: FileUtils.mkpath(@outdir) end @compression = opts[:compression] + @rate = opts[:rate] + @bits = opts[:bits] fails = [] tracks = @tracks.dup -- cgit v1.2.3-24-ge0c7