sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* splice not working correctly
@ 2019-12-23 22:43 Zsolt Ero
  2019-12-23 22:51 ` Zsolt Ero
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zsolt Ero @ 2019-12-23 22:43 UTC (permalink / raw)
  To: sox-users

Hello,

I'd like to use split to mix two slightly different tracks for AB
testing purposes. I'd like to have 0..5 second from track A and 5..10
seconds from track B, etc. 10..15 track A, 15..20 track B.

I'd be very important to make sure that it doesn't change the signal
in any way, as in if I run it with identical tracks, I'd get back the
original track.

My problem is that it's not what is happening. For validation I'm
using a big excess value = 1 sec + -q for equal cross fade.

So far here are my basic CLI arguments:
sox A.wav tmp/A_0.wav trim 0 6
sox A.wav tmp/A_5.wav trim 4 7
sox tmp/A_0.wav tmp/A_5.wav out.wav splice -q 5,1

Can you correct me in how to use splice correctly? The way I'm using
it I get a bit of an echo / duplication at the end of the first file,
just before the mixing point.

Zsolt


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: splice not working correctly
  2019-12-23 22:43 splice not working correctly Zsolt Ero
@ 2019-12-23 22:51 ` Zsolt Ero
  2019-12-24 14:00 ` Jeremy Nicoll - ml sox users
  2020-04-18 11:19 ` Jan Stary
  2 siblings, 0 replies; 4+ messages in thread
From: Zsolt Ero @ 2019-12-23 22:51 UTC (permalink / raw)
  To: sox-users

It's very visible with silence as the second track.

sox -n -r 96000 -c 2 silence.wav trim 0 7
sox in.wav in_trim.wav trim 0 6
sox in_trim.wav silence.wav out.wav splice -q 5,1

There is this echo / duplication starting already at 3-4 seconds.


On Mon, 23 Dec 2019 at 23:43, Zsolt Ero <zsolt.ero@gmail.com> wrote:
>
> Hello,
>
> I'd like to use split to mix two slightly different tracks for AB
> testing purposes. I'd like to have 0..5 second from track A and 5..10
> seconds from track B, etc. 10..15 track A, 15..20 track B.
>
> I'd be very important to make sure that it doesn't change the signal
> in any way, as in if I run it with identical tracks, I'd get back the
> original track.
>
> My problem is that it's not what is happening. For validation I'm
> using a big excess value = 1 sec + -q for equal cross fade.
>
> So far here are my basic CLI arguments:
> sox A.wav tmp/A_0.wav trim 0 6
> sox A.wav tmp/A_5.wav trim 4 7
> sox tmp/A_0.wav tmp/A_5.wav out.wav splice -q 5,1
>
> Can you correct me in how to use splice correctly? The way I'm using
> it I get a bit of an echo / duplication at the end of the first file,
> just before the mixing point.
>
> Zsolt


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: splice not working correctly
  2019-12-23 22:43 splice not working correctly Zsolt Ero
  2019-12-23 22:51 ` Zsolt Ero
@ 2019-12-24 14:00 ` Jeremy Nicoll - ml sox users
  2020-04-18 11:19 ` Jan Stary
  2 siblings, 0 replies; 4+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2019-12-24 14:00 UTC (permalink / raw)
  To: sox-users

On 2019-12-23 22:43, Zsolt Ero wrote:
> Hello,
> 
> I'd like to use split to mix two slightly different tracks for AB
> testing purposes. I'd like to have 0..5 second from track A and 5..10
> seconds from track B, etc. 10..15 track A, 15..20 track B.
> 
> I'd be very important to make sure that it doesn't change the signal
> in any way, as in if I run it with identical tracks, I'd get back the
> original track.

The manual says that 'splice' does a cross-fade at each join.  I suppose
that if the pieces being joined are identical the resulting file should
be the same as either one of the originals, but I don't know if they
would be if you compared the value of every sample.  You'd need there to
have been no arithmetic rounding errors at any point.


> My problem is that it's not what is happening. For validation I'm
> using a big excess value = 1 sec + -q for equal cross fade.


I don't know the answer.  Am I right in saying that you expect:

> So far here are my basic CLI arguments:
> sox A.wav tmp/A_0.wav trim 0 6

   so that gives you a file containing the first 6 seconds
   of audio from A.wav

> sox A.wav tmp/A_5.wav trim 4 7

   and that gives you a file containing 3 seconds of audio,
   taken from the points between 4 secs and 7 secs in A.wav

   So... the last  two seconds of tmp/A_0.wav are identical
      to the first two seconds of tmp/A_5.wav

> sox tmp/A_0.wav tmp/A_5.wav out.wav splice -q 5,1

   sox the-6-sec-file the-3-sec-file   splice -q 5,1

   So that would produce a file that has

       the first 5 seconds of the 6-second file

       a two second part that cross-fades the last second
        of the 6-second file into the first second of the
          3-second file

       then the remaining 2 secs of the 3-sec file

   And you'd expect the cross-fade to be inaudible because
   it occurs between two pieces of identical audio?


> Can you correct me in how to use splice correctly? The way I'm using
> it I get a bit of an echo / duplication at the end of the first file,
> just before the mixing point.


In the manual, the picture with the tape analogy is ... confusing.  The
text explicitly says that "... the position at which to perform the 
splice
—- this is length of the first audio section (including the excess)."  
But
the labelling of the picture shows the join point (asterisked) where
length1 is, and the fade starting before it (& excess projecting past 
it).

It seems to me that the picture says that the length of the cross-fade 
is
twice the "excess", but it starts at length1 - excess.

There is no explanation of what the "leeway" parameter does/means.


-- 
Jeremy Nicoll - my opinions are my own


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: splice not working correctly
  2019-12-23 22:43 splice not working correctly Zsolt Ero
  2019-12-23 22:51 ` Zsolt Ero
  2019-12-24 14:00 ` Jeremy Nicoll - ml sox users
@ 2020-04-18 11:19 ` Jan Stary
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Stary @ 2020-04-18 11:19 UTC (permalink / raw)
  To: sox-users

On Dec 23 23:43:13, zsolt.ero@gmail.com wrote:
> I'd like to use split

Do you mean sox, or some splitting functionality of sox
I am not aware of? SoX can split channels, but that's
probably not what you want.

> to mix two slightly different tracks for AB
> testing purposes. I'd like to have 0..5 second from track A and 5..10
> seconds from track B, etc. 10..15 track A, 15..20 track B.
> 
> I'd be very important to make sure that it doesn't change the signal
> in any way,

So you can't use splice, as that will change the signal.
Why do you want to splice them, instead of
merely concatenating the pieces together?

> as in if I run it with identical tracks, I'd get back the
> original track.

If the two inputs are identical, then I guess their splice
will also be identical to each of them. But if you simply
concatenate the pieces (interlacing), extracting them back
will give you the original two files.

Jan



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-18 11:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-23 22:43 splice not working correctly Zsolt Ero
2019-12-23 22:51 ` Zsolt Ero
2019-12-24 14:00 ` Jeremy Nicoll - ml sox users
2020-04-18 11:19 ` Jan Stary

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).