sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Jeremy Nicoll - ml sox users <jn.ml.sxu.88@wingsandbeaks.org.uk>
To: sox-users@lists.sourceforge.net
Subject: Re: What´s wrong with my batch script?
Date: Sat, 23 Sep 2017 15:10:34 +0100	[thread overview]
Message-ID: <05b65cb2ca6f227c796247829198a0c9@wingsandbeaks.org.uk> (raw)
In-Reply-To: <CAALo0snpsZu-r6JBu2wE-w9wxc2nmWEPK6vNXwzENuAmWfSgXQ@mail.gmail.com>

On 2017-09-23 00:26, AE Photos02 wrote:
> Hello everyone.
> 
> I am making a script that is supposed to mix together 2 separate 
> versions
> of the same files. So far so good. Now it has to be able to do this in 
> a
> batch of all files in one folder, to an output file, a mixed file.
> 
> The idea is to have samples called *sweep1.wav be combined with the 
> files
> called *sweep2.wav. So far my script is combining *only* one specific 
> *"sweep1"
> file*, the last in my list *(which is number 3)*, with one the correct
> "sweep2" file.
> 
> 
> *Here´s the script so far:*
> 
> -------------------------
> 
> for file in ./*sweep1*
> 
> do
> 
> for file2 in ./*sweep2*
> 
>     do
> 
>         out=COMBINED
> 
>         sox -V4 -m -v 1 $file -v 1 $file2 $file-$out.wav
> 
>     done
> 
> done
> 
> --------------------------
> 
> 
> As you may see I have put -v 1 in front of both of the files. If I do 
> not,
> the two files will be mixed with a linear gain of 0.5, I guess half of 
> its
> linear gain value.
> 
> Hope someone can see my error here. The output should be the 
> combination of
> the two first files with the same file name tokens. The method is 
> "mix",
> -m.

Change the script so that instead of

    sox -V4 -m -v 1 $file -v 1 $file2 $file-$out.wav

it issues

    echo sox -V4 -m -v 1 $file -v 1 $file2 $file-$out.wav

(if that's appropriate for the script language concerned) and find out 
what the
set of sox commands it actually issues are.  If it only issues one 
command then
you need to fix the script - not a sox problem.

Is it by any chance seeing the combined file (whose name will start with 
$file)
as one of the files seen by the outer loop?  Maybe it would be better to 
put the
new files in a different folder.


-- 
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

  reply	other threads:[~2017-09-23 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 23:26 What´s wrong with my batch script? AE Photos02
2017-09-23 14:10 ` Jeremy Nicoll - ml sox users [this message]
2017-09-23 14:27   ` Jan Stary
  -- strict thread matches above, loose matches on Subject: below --
2017-09-24 17:21 AE Photos02
2017-09-24 19:04 ` Jeremy Nicoll - ml sox users
2017-09-25 21:14   ` AE Photos02

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=05b65cb2ca6f227c796247829198a0c9@wingsandbeaks.org.uk \
    --to=sox-users@lists.sourceforge.net \
    /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).