[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] splitfx: ensure rate is an integer
From: |
Eric Wong |
Subject: |
[PATCH] splitfx: ensure rate is an integer |
Date: |
Sat, 6 Jun 2015 04:10:00 +0000 |
We'll be using the rate for automatically calculating CDDA
alignment in the future.
---
bin/dtas-splitfx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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
--
EW
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] splitfx: ensure rate is an integer,
Eric Wong <=