[Webkit-unassigned] [Bug 97290] New: Loud sounds turning up when using Web Audio API where no sound expected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 20 21:43:07 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=97290

           Summary: Loud sounds turning up when using Web Audio API where
                    no sound expected
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Other
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Web Audio
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: srikumarks at gmail.com
                CC: eric.carlson at apple.com, crogers at google.com,
                    jer.noble at apple.com


OS: iOS6
Device Type: iPhone4

Steps to reproduce:

The following code is not expected to produce any sound since the volume set is 0, but once in a while you get a loud "ping" if you keep reloading the page in Mobile Safari on iOS6. Less than 10 attempts are needed to produce this effect.

{{{
<script>
    var ac = new webkitAudioContext();

    var attack = 0.01;
    var decay = 0.5;

    function note(t, f, v) {
        var osc = ac.createOscillator();
        osc.frequency.value = f;
        var gain = ac.createGainNode();
        gain.gain.setValueAtTime(0, t);
        gain.gain.linearRampToValueAtTime(v, t + attack);
        gain.gain.setTargetValueAtTime(0, t + attack, decay);
        osc.connect(gain);
        gain.connect(ac.destination);
        osc.noteOn(t);
        osc.noteOff(t + 12 * decay);
    }

    note(ac.currentTime, 880, 0);
</script>
}}}

I've occasionally heard such loud sounds in Chrome 21.0.1180.89 and Safari 6 on MacOS 10.8.1 and so I believe it might be present in the WebKit implementation across the board.

Some other observations -

1. Changing the line "gain.gain.setValueAtTime(0, t);" to "gain.gain.value = 0;" seems to result in the code doing the right thing - i.e. I never got the loud ping on several attempts.

2. Changing the line "note(ac.currentTime, 880, 0);" to "note(ac.currentTime + 0.01, 880, 0);" also seems to resolve this issue.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list