From df440648dd2c087cebfcb64b4860ae8832f19fa7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Oct 2015 00:57:10 +0000 Subject: dtas-archive: allow specifying SoX compression factor This can speed up archiving in some cases, as FLAC with compression-level 8 may be excessively slow. --- bin/dtas-archive | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/dtas-archive b/bin/dtas-archive index 69fc40e..89ca6cc 100755 --- a/bin/dtas-archive +++ b/bin/dtas-archive @@ -27,10 +27,14 @@ jobs = 1 repeat = 1 stats = false keep_going = false +compression = [] OptionParser.new('', 24, ' ') do |op| op.banner = usage op.on('-t', '--type [TYPE]', 'FILE-TYPE (default: flac)') { |t| type = t } + op.on('-C', '--compression [FACTOR]', 'compression factor for sox') { |c| + compression = [ '-C', c ] + } op.on('-j', '--jobs [JOBS]', Integer) { |j| jobs = j } op.on('-S', '--stats', 'save stats on the file') { stats = true } op.on('-k', '--keep-going', 'continue after error') { keep_going = true } @@ -146,7 +150,7 @@ thrs = jobs.times.map do |i| end end - cmd = [ 'sox', input, output ] + cmd = [ 'sox', input, *compression, output ] if stats cmd << 'stats' cmd = [ *cmd, { err: stats_out } ] -- cgit v1.2.3-24-ge0c7