From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 208.118.235.0/24 X-Spam-Status: No, score=-2.3 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: dtas-all@80x24.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7EBF220421 for ; Mon, 19 Oct 2015 18:08:10 +0000 (UTC) Received: from localhost ([::1]:41415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEqv-0003lT-WA for dtas-all@80x24.org; Mon, 19 Oct 2015 14:08:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEqu-0003lF-Jw for dtas-all@nongnu.org; Mon, 19 Oct 2015 14:08:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoEqr-0004ky-EF for dtas-all@nongnu.org; Mon, 19 Oct 2015 14:08:08 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:53894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoEqr-0004kW-17 for dtas-all@nongnu.org; Mon, 19 Oct 2015 14:08:05 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3CF6620421 for ; Mon, 19 Oct 2015 18:08:03 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] dtas-archive: allow specifying SoX compression factor Date: Mon, 19 Oct 2015 18:08:03 +0000 Message-Id: <20151019180803.14801-1-e@80x24.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.71.152.64 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+dtas-all=80x24.org@nongnu.org Sender: dtas-all-bounces+dtas-all=80x24.org@nongnu.org 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