Re: Behaviour of AudioParam.cancelScheduledValues

On Tue, Nov 22, 2016 at 4:25 AM, Sebastian Zimmer <sebzim2@web.de> wrote:

> Hi fellow developers,
>
> I have two questions regarding AudioParam automation in the Web Audio spec:
>
> 1.
>
> To me, it is unclear what happens, when calling
> AudioParam.cancelScheduledValues while an automation curve is active.
>

Hmm.  This really needs to be clarified in the spec.

However, take a look at  cancelAndHoldAtTime
<https://webaudio.github.io/web-audio-api/#widl-AudioParam-cancelAndHoldAtTime-AudioParam-double-cancelTime>.
This specifies what happens when automations are running at the time that
cancel should happen.  However, I don't think any browser implements this
yet.

This doesn't answer your original question about cancelScheduledValues.

>
> An example:
>
> gainNode.gain.value = 0.5;
> gainNode.gain.linearRampToValueAtTime(0, context.currentTime + 3);
> /* One second later, while the linear curve is active, we call */
> gainNode.gain.cancelScheduledValues(context.currentTime);
>
> Of course, the linear ramp will be cancelled, because endTime of
> linearRampToValue is greater than the cancelTime in cancelScheduledValues.
> I assume that the value should immediately jump back to the initial one,
> i.e. 0.5. Or am I wrong?
>
> 2.
>
> Currently, there is this sentence in the spec at
> AudioParam.cancelScheduledValues [1]:
> "Active setTargetAtTime automations (those with cancelTime less than the
> supplied time value) will also be cancelled."
>
> Would this not also apply to active linearRampToValueAtTime,
> setValueCurveAtTime and exponentialRampToValue automations?
>
> Thank you,
> Sebastian
>
> [1] https://webaudio.github.io/web-audio-api/#widl-AudioParam-ca
> ncelScheduledValues-AudioParam-double-cancelTime
>
>
>

Received on Monday, 28 November 2016 16:31:30 UTC