diff options
author | Eric Wong <e@80x24.org> | 2015-10-19 00:57:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-10-19 00:57:10 +0000 |
commit | df440648dd2c087cebfcb64b4860ae8832f19fa7 (patch) | |
tree | 0be08a4055bd74bb911153509a514887e8aab257 /bin | |
parent | 5560d4b462e10c5430d7a74f445ffe0d1611d0cc (diff) | |
download | dtas-df440648dd2c087cebfcb64b4860ae8832f19fa7.tar.gz |
This can speed up archiving in some cases, as FLAC with compression-level 8 may be excessively slow.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dtas-archive | 6 |
1 files changed, 5 insertions, 1 deletions
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 } ] |