sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: "Ulf A. S. Holbrook via Sox-users" <sox-users@lists.sourceforge.net>
To: sox-users@lists.sourceforge.net
Cc: "Ulf A. S. Holbrook" <post@u-l-v.org>
Subject: Re: Help with --combine merge
Date: Mon, 16 Oct 2023 13:10:07 +0200	[thread overview]
Message-ID: <61c9fb0e-a403-015d-6e6f-74f6ae05c28c@u-l-v.org> (raw)
In-Reply-To: <fcdab26452d6759bb3a916757ab8864c@wingsandbeaks.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 2307 bytes --]

I think you'd be on to something! The for-loop probably calls sox at 
each loop and causes some issues.

However, if I run

sox --combine merge *.WAV merged.wav

or write to a different directory, it still merged everything into the 
last file in the list /and /it creates a new file.

So, I have files labelled 1.wav ... 90.wav Each are 1 minute long. When 
running the merge command, the last file in the list becomes the one 
everything is merged into, and ends up having 89 channels and not 90. 
The new merged.wav ends up being 8 seconds long, yet have 178 channels, 
ie 89 x2. So somewhere along the line the loop is doubled, and I cannot 
understand how.


/*
Ulf A. S. Holbrook
post@u-l-v.org
http://www.u-l-v.org/
+47 99569230
*/

On 15/10/2023 22:39, Jeremy Nicoll - ml sox users wrote:
> On 2023-10-15 14:27, Ulf A. S. Holbrook via Sox-users wrote:
>> Hello!
>>
>> I'm trying to combine a large amount of files into one single file 
>> and wondered if someone could lend a hand. I have individual folders 
>> of 90 1-minute files in .wav and want to merge them into one 
>> 90-channel file. I'm running
>>
>> for file in /dir
>>
>> do
>>
>> sox --combine merge *.WAV >> merged.wav
>>
>> done
>
>
> I am guessing here ... and if that's a linux shell command I don't 
> know if
> it evaluates *.WAV just once or more than once.  It's also not clear 
> to me
> if you delete merged.wav between experiments.
>
>
> I've never seen an example sox command that uses redirection to place 
> output
> in a result file, so wonder if what's (not) being written there is 
> progress
> or error messages rather than audio data?  Perhaps
>
>    sox --combine merge *.WAV merged.wav
>
> or
>
>    sox --combine merge *.WAV \anotherdir\merged.wav
>
> would work better.
>
>
> It looks to me as if your code runs sox many times.  Why not run it just
> once reading all the input files in one operation?
>
> If multiple runs ARE needed, does it work when the source directory only
> contains one file?  Or two files?  Can you make a copy of the generated
> file each time - NOT in the same directory, so there's no risk of it 
> being
> matched by the "*.WAV" if that pattern is matched multiple times? - and
> examine each run's output to see what it actually contains (eg with the
> stats effect)?
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3617 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

  reply	other threads:[~2023-10-16 11:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-15 13:27 Help with --combine merge Ulf A. S. Holbrook via Sox-users
2023-10-15 20:39 ` Jeremy Nicoll - ml sox users
2023-10-16 11:10   ` Ulf A. S. Holbrook via Sox-users [this message]
2023-10-17 12:14     ` Jan Stary
2023-10-16 10:44 ` Jan Stary
2023-10-16 11:28   ` Ulf A. S. Holbrook via Sox-users
2023-10-17 12:05     ` Jan Stary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61c9fb0e-a403-015d-6e6f-74f6ae05c28c@u-l-v.org \
    --to=sox-users@lists.sourceforge.net \
    --cc=post@u-l-v.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.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).