about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--Documentation/dtas-splitfx.txt6
-rwxr-xr-xbin/dtas-splitfx2
-rw-r--r--lib/dtas/splitfx.rb6
3 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/dtas-splitfx.txt b/Documentation/dtas-splitfx.txt
index 38c1cca..049371f 100644
--- a/Documentation/dtas-splitfx.txt
+++ b/Documentation/dtas-splitfx.txt
@@ -45,6 +45,12 @@ to use ecasound(1), too.
 :    Set the compression factor passed to sox(1).  See soxformat(7)
     for more information on how it works across different formats.
 
+-r, \--rate RATE
+:    Override the output sample rate in the specified TARGET
+
+-b, \--bits BITS
+:    Override the output bit depth in the specified TARGET
+
 # FILE FORMAT
 
 * infile - string, the pathname of the original audio file
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx
index edd7dd3..b5741a0 100755
--- a/bin/dtas-splitfx
+++ b/bin/dtas-splitfx
@@ -16,6 +16,8 @@ OptionParser.new('', 24, '  ') do |op|
   op.on('-D', '--no-dither') { |val| opts[:no_dither] = true }
   op.on('-O', '--outdir OUTDIR') { |val| opts[:outdir] = val }
   op.on('-C', '--compression FACTOR') { |val| opts[:compression] = val }
+  op.on('-r', '--rate RATE') { |val| opts[:rate] = val }
+  op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] = val }
   op.parse!(ARGV)
 end
 
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