New issue
Advanced search Search tips

Issue 630869 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

AudioParam.setTargetAtTime() always results in 0 for timeConstant=0

Project Member Reported by toyoshim@chromium.org, Jul 24 2016

Issue description

I confirmed this problem on GainNode, and didn't check on other nodes.
But it does not work correctly when setTargetAtTime() is called with timeConstant=0.

Confirmed at Chrome version: 51.0.2704.103 (Official Build)


Example code snippet.

const context = new AudioContext;
const osc = context.createOscillator();
osc.start();

const gain = context.createGain();
osc.connect(gain).connect(context.destination);

const target = 1.0;
const timeConstant = 0.0;
gain.gain.setTargetAtTime(target, context.currentTime, timeConstant);


This results in generating click noise and silence.

Note:
1. Click noise is always generated at the start time of setTargetAtTime regardless of target and timeConstant values.
2. If timeConstant is 0, gain results in 0 regardless of the target value.


Demo: https://jsfiddle.net/toyoshim/0ynt4bz7/
 
Spec says "The value must be strictly positive or a TypeError exception must be thrown".
Sorry if this is just not implemented yet, but if "strictly positive" means "greater than 0", this must throw TypeError, right?

Comment 2 by rtoy@chromium.org, Jul 25 2016

Status: Available (was: Untriaged)
Yeah, it's supposed to throw an error if the time constant is zero.  Chrome 52 does, in fact, throw an error.

But see https://github.com/WebAudio/web-audio-api/issues/850.  No resolution on that issue yet.  This would be an incompatible but minor change.
Oh, thanks.
Let me join the discussion there :)

Comment 5 by rtoy@chromium.org, Oct 20 2016

Owner: rtoy@chromium.org
Status: Started (was: Available)
Woohoo! Thank you for working on this :)

Comment 8 by rtoy@chromium.org, Dec 13 2016

Status: Fixed (was: Started)
Sorry for taking so long.  Hope this helps you out!

Sign in to add a comment