From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 21A561F44D for ; Mon, 25 Mar 2024 10:11:12 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sourceforge.net header.i=@sourceforge.net header.a=rsa-sha256 header.s=x header.b=GjFsarmC; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sf.net header.i=@sf.net header.a=rsa-sha256 header.s=x header.b=P/gXYMMT; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yhbt.net header.i=@yhbt.net header.a=rsa-sha256 header.s=selector1 header.b=Nkayoom2; dkim-atps=neutral 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.95) (envelope-from ) id 1rohI5-0002lN-Qu; Mon, 25 Mar 2024 10:10:54 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rohI4-0002lE-NB for sox-users@lists.sourceforge.net; Mon, 25 Mar 2024 10:10:53 +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=PWpPRsU2Grs2jQGna3SESAxf7LkjgAvgGXwZ/0kmeNg=; b=GjFsarmCR9vhfCPg/Y8fWk51V1 VQ1XlMduGjoQK9xzueKdetJc1EnMXcJIadkDN090XtDu97KlmwYBChPxakWu0x05WFEOhHxXpsHaY SGIZSmLQn+aULlfXal62fYdkd8Is/EGLrzgwCCLupTLRRaF0yAjR1mC7g/VUm5j0BE+w=; 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=PWpPRsU2Grs2jQGna3SESAxf7LkjgAvgGXwZ/0kmeNg=; b=P/gXYMMTXtX3O1fZl1I+4NPkpe 0BCLNRgFEAHgSnWRR9in32g9dwMXW+tRKwohnFwMowx8B4Cbq1DDDDAypKKCFr+AfVPMY2qyZrSTe wo5gUKSxjQr1Qc61bUqV++gWd7CuEJatykNdkpyFYPprYh9O8hMM1DRpp9DSP7hGW7Vc=; Received: from dcvr.yhbt.net ([173.255.242.215]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rohI3-0003mn-8B for sox-users@lists.sourceforge.net; Mon, 25 Mar 2024 10:10:53 +0000 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 786421F44D; Mon, 25 Mar 2024 09:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yhbt.net; s=selector1; t=1711360519; bh=PnGzQ5jsXMFFxCK3PSVqZIuSRIQ4R8HYwrTQh00namY=; h=Date:From:To:Subject:References:In-Reply-To:From; b=Nkayoom2aTKz/XbXy/CybZ92wFCDxUoyuudECQRtkrugCKDgP01GSrZqDa1wke+dl tlnxvvnavSr5Tcf6qkOiIby57iVpeEifr+fRifXDbxJ1qO/UsRxuEWo2rb1r1yMC8/ B4OU87JtLWQS3mkDxUgIXWJ1iQaJ/d1h6bkZGrJE= Date: Mon, 25 Mar 2024 09:55:19 +0000 From: Eric Wong To: sox-users@lists.sourceforge.net Message-ID: <20240325095519.M332919@dcvr> References: <58F57788-B837-4336-B998-EC48649026F8@klaus-kauker.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <58F57788-B837-4336-B998-EC48649026F8@klaus-kauker.de> X-Headers-End: 1rohI3-0003mn-8B Subject: Re: trim slow with multiple 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: sox-users-bounces@lists.sourceforge.net Klaus Kauker wrote: > Hey there > > if I play one single file with e.g. 30 seconds in it plays pretty much instantly. e.g.: play file1.mp3 trim 30 Right, src/sox.c has optimize_trim() when trim is the first effect but AFAIK it only affects single inputs > If I pass more than one file sox somehow takes much longer to seek to the desired position: play file1.mp3 file2.mp3 trim 30 Yeah, the optimize_trim() function only triggers with single inputs. Maybe Jan has a faster computer and didn't notice "trim 30" taking longer to start than no trim at all. Using a larger value (e.g. "trim 300" on longer audio files) will make a more noticeable delay for faster computers. > I think modifying the command to: play file1.mp3 trim 30 ; play file2.mp3 works fine in most cases but it introduces an audible gap between the files. Right, that will restart your audio device, and AFAIK sox doesn't make use of the metadata required for gapless mp3 playback. (FLAC and most other formats don't need special code for gapless) > Is there a solution for gapless playback and fast trimming? You can have two sox invocations write to the same pipe via subshell: FMT='-t s32 -r 44100 -c2' # any format will work, but it has to be consistent (sox file1.mp3 $FMT - trim 30 && sox file2.mp3 $FMT -) | play $FMT - I expect the gaps will still be there with mp3 files, though. _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users