everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
* [PATCH] dtas-archive: allow specifying SoX compression factor
@ 2015-10-19 18:08 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-10-19 18:08 UTC (permalink / raw)
  To: dtas-all

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 } ]
-- 
EW



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-19 18:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-19 18:08 [PATCH] dtas-archive: allow specifying SoX compression factor Eric Wong

Code repositories for project(s) associated with this public inbox

	http://80x24.org/dtas.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).