"delay" the other way

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

"delay" the other way

a1s2d3f4
I have been using a command that puts together a stereo file based on two other input files and delays one of them by a value I determine previously.

sox -M input1.wav input2.wav output.wav trim 0 300 delay 0.5 0 remix 1 2

So, now I need to actually shift my first channel audio the other way.
I was trying delay -0.5 and it failed.

Is there an easy work around?

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: "delay" the other way

Jeremy Nicoll - ml sox users
On 2016-03-25 15:16, Anatoly L wrote:

> I have been using a command that puts together a stereo file based on
> two
> other input files and delays one of them by a value I determine
> previously.
>
> sox -M input1.wav input2.wav output.wav trim 0 300 delay 0.5 0 remix 1
> 2
>
> So, now I need to actually shift my first channel audio the other way.
> I was trying delay -0.5 and it failed.
>
> Is there an easy work around?

Would you not then use: delay 0 0.5       to delay right channel instead
of
left channel?

Also (I'm new to this, so this may be a stupid question), is the "remix
1 2" on the
end of your command actually needed?  Is it because input1 and input2,
once merged,
have more than two channels in them?

Also... it might be simpler, rather than merging channel then fiddling
with delays to
prepare slightly different versions of input1 or input2, then merge them
without a
delay parameter.

For example, you could use the 'pad' effect to add a short length of
silence to one or
other input file, then merge that longer file with the other original
input file.


I'm sure this kind of thing is easier to do in stages, at first, rather
than trying
to find one command that will do everything.

--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: "delay" the other way

a1s2d3f4
remix 1 2 is indeed not needed.
I use plenty of other similar commands, with a greater number of inputs and greater number of channels in the output, where this remix effect is needed and I simply kept it in just for "consistency".

So, it seems based on what I understood from reading through the manual, there is no way to easily shift data in one of the channels to earlier. I am not sure why "delay" couldn't be redesigned to accept a negative value. Why not? (That would be a question to someone in charge of code).

I'd prefer not to shift channel 2 because I am actually putting SMPTE data into it, and I'd like it to be correctly aligned to the real time, rather than have a random offset.

Yes, indeed, a separate "trim" command creating a temporary file of my channel 1 data is a possibility. Nothing wrong with that per se. I just wanted to avoid having to rewrite a complicated formula in googledocs that automatically builds my command line from values in spreadsheets ...

On Sat, Mar 26, 2016 at 9:33 AM, Jeremy Nicoll - ml sox users <[hidden email]> wrote:
On 2016-03-25 15:16, Anatoly L wrote:
> I have been using a command that puts together a stereo file based on
> two
> other input files and delays one of them by a value I determine
> previously.
>
> sox -M input1.wav input2.wav output.wav trim 0 300 delay 0.5 0 remix 1
> 2
>
> So, now I need to actually shift my first channel audio the other way.
> I was trying delay -0.5 and it failed.
>
> Is there an easy work around?

Would you not then use: delay 0 0.5       to delay right channel instead
of
left channel?

Also (I'm new to this, so this may be a stupid question), is the "remix
1 2" on the
end of your command actually needed?  Is it because input1 and input2,
once merged,
have more than two channels in them?

Also... it might be simpler, rather than merging channel then fiddling
with delays to
prepare slightly different versions of input1 or input2, then merge them
without a
delay parameter.

For example, you could use the 'pad' effect to add a short length of
silence to one or
other input file, then merge that longer file with the other original
input file.


I'm sure this kind of thing is easier to do in stages, at first, rather
than trying
to find one command that will do everything.

--
Jeremy Nicoll - my opinions are my own

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: "delay" the other way

Fmiser
> Anatoly wrote:
>
> I have been using a command that puts together a stereo
> file based on two other input files and delays one of them
> by a value I determine previously.
>
> So, now I need to actually shift my first channel audio the
> other way. I was trying delay -0.5 and it failed.
>
> Is there an easy work around?

> I'd prefer not to shift channel 2 because I am actually
> putting SMPTE data into it, and I'd like it to be correctly
> aligned to the real time, rather than have a random offset.

It's not possible to advance anything.  SoX is amazing, but
it cannot predict the future, therefore it cannot apply a
negative delay.  The only way it could simulate this is by
adding delay to all the other channels - which you don't want
to do because the SMTPE timecode won't match realtime.

So until SoX can travel in time, I don't see a solution.

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: "delay" the other way

Johnny Rosenberg
2016-03-27 5:29 GMT+02:00 fmiser <[hidden email]>:
> Anatoly wrote:
>
> I have been using a command that puts together a stereo
> file based on two other input files and delays one of them
> by a value I determine previously.
>
> So, now I need to actually shift my first channel audio the
> other way. I was trying delay -0.5 and it failed.
>
> Is there an easy work around?

> I'd prefer not to shift channel 2 because I am actually
> putting SMPTE data into it, and I'd like it to be correctly
> aligned to the real time, rather than have a random offset.

It's not possible to advance anything.  SoX is amazing, but
it cannot predict the future, therefore it cannot apply a
negative delay.  The only way it could simulate this is by
adding delay to all the other channels - which you don't want
to do because the SMTPE timecode won't match realtime.

So until SoX can travel in time, I don't see a solution.

Well, it's a file, isn't it? So no need for looking in the future. Just implement Lookahead. In the file, not in the future…
So what to do with the data that starts at the negative part of the timeline after the negative ”delay”? Well, just throw them away! It doesn't need to be harder than that…


Kind regards

Johnny Rosenberg


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: "delay" the other way

Måns Rullgård
In reply to this post by a1s2d3f4
Anatoly L <[hidden email]> writes:

> I have been using a command that puts together a stereo file based on two
> other input files and delays one of them by a value I determine previously.
>
> sox -M input1.wav input2.wav output.wav trim 0 300 delay 0.5 0 remix 1 2
>
> So, now I need to actually shift my first channel audio the other way.
> I was trying delay -0.5 and it failed.
>
> Is there an easy work around?

Delay the other channel and "trim" the start.

--
Måns Rullgård

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users