about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-06-03 10:16:58 +0000
committerEric Wong <e@80x24.org>2015-06-03 10:16:58 +0000
commitee3c6d6e91d3bda8e576ce79aca9b283eca7bf9d (patch)
tree95f1d2d0987763c3b1f69064b79415285c933ce8
parent741bb52962c874ddc5ad72bdac8a183e49c8abe9 (diff)
downloaddtas-ee3c6d6e91d3bda8e576ce79aca9b283eca7bf9d.tar.gz
We'll be using the rate for automatically calculating CDDA
alignment in the future.
-rwxr-xr-xbin/dtas-splitfx5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx
index fc8cc69..08c0111 100755
--- a/bin/dtas-splitfx
+++ b/bin/dtas-splitfx
@@ -16,7 +16,10 @@ OptionParser.new('', 24, '  ') do |op|
   op.on('-D', '--no-dither') { 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('-r', '--rate RATE') do |val|
+    mult = val.sub!(/k\z/, '') ? 1000 : 1
+    opts[:rate] = (val.to_f * mult).to_i
+  end
   op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] = val }
   op.on('-t', '--trim POSITION') { |val| opts[:trim] = val.tr(',', ' ') }
   op.on('-p', '--sox-pipe') do