Re: Help with --combine merge

Jeremy Nicoll - ml sox users <[email protected]> Sun, 15 Oct 2023 21:39:59 +0100
Newsgroups gmane.comp.audio.sox
Message-ID <[email protected]>
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)?



-- 
Jeremy Nicoll - my opinions are my own