Closed
Bug 1438353
Opened 7 years ago
Closed 6 years ago
GainNode.gain.value completely breaks after using setValueAtTime(), linearRampToValueAtTime()
Categories
(Core :: Web Audio, defect, P2)
Tracking
()
RESOLVED
DUPLICATE
of bug 893020
People
(Reporter: tszynalski, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20180206200532
Steps to reproduce:
1. Go to https://jsfiddle.net/tszynalski/1gpq6z6q/37/
2. The initial gain is 0.1.
3. Set gain to 0.2 using setValueAtTime()
4. Click "Show Gain". The value from GainNode.gain.value has not been updated. It still says 0.1 (the initial value).
5. Click "Set Gain to 0" (this executes "GainNode.gain.value = 0"). This should silence the audio, but nothing happens.
If you use GainNode.gain.linearRampToValueAtTime() instead of setValueAtTime(), it's the same.
Actual results:
In short, after you use GainNode.gain.setValueAtTime() or GainNode.gain.linearRampToValueAtTime() (and probably other similar methods), the GainNode.gain.value parameter is not updated. It also stops being writable, i.e. assigning a new value has no effect.
This makes it impossible to write a smooth volume control (without pops). You'd need to do something like:
function changeVolumeSmoothly(newVol) {
//go from current volume level...
GainNode.gain.linearRampToValueAtTime(GainNode.gain.value, currentTime);
//...to the new volume level
GainNode.gain.linearRampToValueAtTime(newVol, currentTime + SOME_DELAY);
}
But without the correct current gain value from GainNode.gain.value, you can't do a smooth change.
Expected results:
See above.
Comment 1•7 years ago
|
||
I can reproduce this issue on Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0 and Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
I even tested on Google Chrome and Step 5 does silence the audio.
Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
Comment 2•7 years ago
|
||
Sounds to me like this could be bug 1308435. Or at the least related.
Status: UNCONFIRMED → NEW
Rank: 15
Component: WebRTC: Audio/Video → Web Audio
Ever confirmed: true
Priority: -- → P2
Comment 3•6 years ago
|
||
In general, there are lots of issues with Gecko AudioParam implementation, especially around the behaviour of the value attribute, that has never been properly specced.
I've been trying to work on it for some time, but haven't been successful yet.
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•