From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E69A71F731 for ; Sat, 10 Aug 2019 17:29:04 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1hwVAp-0000HY-Ii; Sat, 10 Aug 2019 17:28:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hwVAo-0000HN-FV for sox-users@lists.sourceforge.net; Sat, 10 Aug 2019 17:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mrgai5xKTP92gGfE8nD/Bl9ZVUpYaXt3sbDx5cFDZNA=; b=P0MtFgh5mW/pLSGDfwwmjm+EHe NuiccsLYR5DzpSZmetBYO+vbsxUVvxMGRyBq+dfuCeYZKRoqoFsbsQ51QyCRN7E0FbxgO0ndBj2VI Dt4tYL/WlKVXFhhau99Be9xw8+mQXrR/dyJRY/xxVXDqyccdSAz7s0BEYM570oCSA98Q=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mrgai5xKTP92gGfE8nD/Bl9ZVUpYaXt3sbDx5cFDZNA=; b=Id0dyjlRDi5R/2oFT1QEbvlS2G 1yWnH5XZBCZ7+W1rJbXwWKv9v2ZYNVTojD0g2TYDSSVmmFefL/ooJBfVO8xPB9HgLUUpdZVU3wBTW X8kKOlnylBpskf/Hgchd++X+toBRzsYYsXGRSCZBMbpfurAI/EPl/c+Y18kbd5Yz0Aqo=; Received: from unicorn.mansr.com ([81.2.72.234]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hwVAm-00Gr3e-PG for sox-users@lists.sourceforge.net; Sat, 10 Aug 2019 17:28:58 +0000 Received: by unicorn.mansr.com (Postfix, from userid 51770) id 2B42D16F1D; Sat, 10 Aug 2019 18:28:43 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Jeremy Nicoll - ml sox users References: <66ca46e2-92b8-a920-9b71-52e89ac5c033@gmx.de> Date: Sat, 10 Aug 2019 18:28:43 +0100 In-Reply-To: (Jeremy Nicoll's message of "Sat, 10 Aug 2019 10:52:54 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Headers-End: 1hwVAm-00Gr3e-PG Subject: Re: Reason for sox mix restriction to two or more input files? X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Cc: sox-users@lists.sourceforge.net, thomas@tensi.eu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: sox-users-bounces@lists.sourceforge.net Jeremy Nicoll - ml sox users writes: > On 2019-08-09 20:42, Dr. Thomas Tensi wrote: >> Dear all, >> >> >> I am using sox for automatic, scripted file generation. >> >> One step is a mix of several input files. It may happen >> that - by configuration - only a single input file remains >> for that mixing step. >> >> This cannot be handled by sox, because sox _requires_ >> at least two input files and quits with the message >> "Not enough input filenames specified" >> >> I understand that at least one input file is necessary >> (for finding the target length, sample rate etc.), but >> why does sox fail when mixing a single input file? > > Probably because it's simpler to write programmes that assume > the user means what they say. So if you ask sox to mix several > files, it is written assuming that you will provide more than > one. There doesn't seem to be any good reason for this. The below patch removes the restriction and doesn't seem to break anything based on a quick test. diff --git a/src/sox.c b/src/sox.c index 0b103e269092..39533bac831d 100644 --- a/src/sox.c +++ b/src/sox.c @@ -2924,7 +2924,7 @@ int main(int argc, char **argv) combine_method =3D sox_concatenate; = /* Make sure we got at least the required # of input filenames */ - if (input_count < (size_t)(is_serial(combine_method) ? 1 : 2)) + if (input_count < 1) usage("Not enough input filenames specified"); = /* Check for misplaced input/output-specific options */ -- = M=E5ns Rullg=E5rd _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users