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,UNPARSEABLE_RELAY 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 0F9D01F45A for ; Sat, 18 Apr 2020 09:28:45 +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 1jPjmC-000818-2Q; Sat, 18 Apr 2020 09:28:40 +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 1jPjmA-00080s-Ug for sox-users@lists.sourceforge.net; Sat, 18 Apr 2020 09:28:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding: 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=jBQ1Iu5KWZlgRd0b+VnrXIyMxDEeWIHex/905a8eZ2E=; b=JbRxUDcaUsBuE5AFu3lCLsVe+f QJIK9lJ3cb64kEQHSL5hSUGfx+GAjztoRVH6qyYB21D29d/KBExu67kSN0n46RLKJ71IzZYWth5Ap +DPt9I10Vf+neFG0/13QTKnYTm2aICd2tHE0GHWhZ9ylMZkYuTx42omV3Yd9US6u3BmI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To: From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding: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=jBQ1Iu5KWZlgRd0b+VnrXIyMxDEeWIHex/905a8eZ2E=; b=KQ5u7v65EP/PgzN4P4vzfnH+Wt 2kd1JN1f24zUq1gox4+MzxYJQ5ZqlamwKL3EfGdfBfowpQqlGWxpO8mbcNH07XTSMifRioxlmVsOY wchKwdKurf8xxcRZSvV/cMPIzkq39nzaL9xaTQxSJwFwd91oMCBFXdz5iXLm2u3wZD0Y=; Received: from mx.stare.cz ([79.98.77.229]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jPjm3-006GXK-Gb for sox-users@lists.sourceforge.net; Sat, 18 Apr 2020 09:28:38 +0000 Received: from localhost (stare.cz [local]) by stare.cz (OpenSMTPD) with ESMTPA id 5bb8c1f8 for ; Sat, 18 Apr 2020 11:28:13 +0200 (CEST) Date: Sat, 18 Apr 2020 11:28:12 +0200 From: Jan Stary To: sox-users@lists.sourceforge.net Message-ID: <20200418092812.GA2613@www.stare.cz> References: <2abc00c8-f19a-abbd-f197-2e31b8be6cee@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2abc00c8-f19a-abbd-f197-2e31b8be6cee@gmail.com> X-Headers-End: 1jPjm3-006GXK-Gb Subject: Re: Combine and trim files with silence 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: sox-users-bounces@lists.sourceforge.net On Apr 17 22:11:00, jungleboogie0@gmail.com wrote: > I'm using SoX v14.4.2 and would like help mixing three files, with silence > in between two of them. With silence in between, you probably mean to concatenate them, not to "mix" them. > Problem I want to solve: > Mix three files with, with the longest being shorten to a specific file. Is this unnamed specific file a fourth file, or one of the unspecified three? > I also want a 1.5 second pad between short_track.wav and main_file.wav What _three_ files are those then and in what order do you want to concatenate them? > What I've tried: > sox -m main_file.wav long_track.wav -p pad 1.5 0 | sox - -m short_track.wav > -t wavpcm out.wav trim 0 0 `soxi -D main_file.wav` Ah, so the three files are 1. short_track 2. main_file 3. long track in that order? Which one is "the longest" and to which file's length do you want to shorten it? > Problem is that the file cuts off about 1.5 seconds too quick, which is how > long my pad is. > > I've also tried creating a blank file: > sox -n -r 16000 -b 16 -c 1 silence.wav trim 0.0 1.5 > > Then combining it: > sox short_track.wav silence.wav main_file.wav long_track.wav out.wav trim 0 > `soxi -D main_file.wav` This trims the length of out.wav, not "the longest" of the three files (whichever it is). Is main_file the "specific file" whose lenght you want to use to shorted "the longest"? > But you seasoned sox experts already know this means > log_track.wav isn't used at all. Of course: out.wav gets trimmed before the input even gets to it, being that main_file itself is one of the inputs. > This also cuts off about the last 1.5 seconds of the out.wav > file as well. It trims out.wav to the length of main_file. > So is it possible to combine these files and trim to the main file? Trim _what_ to to length of the main file? In short, you mail is a mess. Tell us what you you need to do _and_why_. Be as specific as possible. Don't talk about "the longest file" without showing the lengths, or "a specific file" without naming it, etc. Trimming a file to another file's length is easy: sox third.wav trimmed.wav trim 0 `soxi -D prototype.wav` soxi -D prototype.wav third.wav trimmed.wav To concatenating three files, with silence between (say) first and second, just pad the first with silence first: sox first.wav padded.wav pad 0 1.5 soxi -D first.wav padded.wav Then just contatenate them: sox padded.wav second.wav trimmed.wav out.wav soxi -D padded.wav second.wav trimmed.wav out.wav rm -rf padded.wav trimmed.wav _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users