Web audio gain node "ramp" methods do not work
Categories
(Core :: Web Audio, defect, P3)
Tracking
()
People
(Reporter: s0ren, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
The methods "exponentialRampToValueAtTime" and "linearRampToValueAtTime" do not work (and havent worked for some months)
Reproducible using your own examples:
https://mdn.github.io/webaudio-examples/audio-param/
The "ramp" methods sometime work the second time you call them, but never the first time. Reloading the page is required to trigger the bug more than once.
Btw the example link in your docs is broken -> https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime
Actual results:
Instead of fading to the desired gain value, it just jumps to said value at the end of the time period specified when calling the methods
Expected results:
the ramp methods should gradually fade the volume instead of setting the volume instantly.
![]() |
||
Updated•6 years ago
|
![]() |
||
Updated•6 years ago
|
Went back to 2016-07 build and still see the issue. Doesn't appear to be a regression, rather a long standing issue. Repros under Windows 10 and Linux for me.
Paul, is this something on your radar?
Updated•6 years ago
|
Paul just closed 1171438 as resolved with a comment that it was fixed, but the bug I reported here still exists in version 134 and is reproducible as described in my original description.
Thus, this is not a duplicate of 1171438.
Comment 4•7 months ago
|
||
https://mdn.github.io/webaudio-examples/audio-param/ works similarly in Chrome and Firefox for me, regardless of if I load the page for the first time or not, linear and exp ramps work as expected.
Can you please reproduce this with logging enabled, here are instructions:
- In Firefox, ideally freshly started with no other tabs, go to
about:logging
in a new tab - Select the Media preset and click Start Logging
- Reproduce the bug
- Back on
about:logging
, click Stop Logging - In the new tab that appears with the Firefox Profiler web application, in the top right click the button to upload the profile
- Make sure hidden threads are included and upload, then share the link here or send privately to a Mozilla developer (e.g. me: padenot@mozilla.com).
Here are the same instructions, in video form, if you prefer that https://paul.cx/public/about-logging-presentation.webm
Thanks, hopefully we can get to the bottom of this.
On the example page (Windows):
- Press play
- Press "Target at time 0 in 1s"
- Wait
- Press "Exponential ramp gain to 1 in 2 seconds"
Result: After two seconds the volume instantly goes from 0 to 1.
Expected: Volume should ramp exponentially to 1.
There are several other combos that recreate the issue, and random errors where suddenly none of the buttons do anything (which may be a problem with the page, have not investigated further).
Updated•7 months ago
|
Comment 6•6 months ago
|
||
AFAICT the ramp methods are behaving as expected in these examples if used on their own, since bug 1171438 was fixed.
There are some remaining issues with combinations of events, such as setTargetAtTime() followed by exponentialRampToValueAtTime(), as reported in comment 5.
A separate issue is that "Target at time 0 in 1s" triggers
gainNode.gain.value = 0;
gainNode.gain.setTargetAtTime(0, audioCtx.currentTime + 1, 0.5);
but the value = 0
appears to have no effect.
The example page ignores any button clicks before the audio element is playing.
Description
•