[Webkit-unassigned] [Bug 275656] New: Disconnection of audio node results in distorted audio

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 18 23:46:02 PDT 2024


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

            Bug ID: 275656
           Summary: Disconnection of audio node results in distorted audio
           Product: WebKit
           Version: Safari 17
          Hardware: Mac (Apple Silicon)
                OS: macOS 14
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Audio
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: marcel-mueller at gmx.de
                CC: cdumez at apple.com

* Create a MediaStreamDestination
* Create an audio element and set the stream as `srcObject`
* Create an an audio node and connect it to the stream
* -> Audio plays fine
* Disconnect the audio node from the stream

Expected: You should hear nothing anymore (given it was the only audio node)
Actual: The last few milliseconds of the audio is repeated in a loop resulting in distorted audio.

Tested on MacOS 14.5 and Safari 17.5

Simple reproduction:

```
document.onclick = () => {
    const audioContext = new (window.AudioContext || window.webkitAudioContext)();

    const destination = audioContext.createMediaStreamDestination();

    playAudio = (stream) => {
        const audioElement = document.createElement('audio');
        audioElement.autoplay = true;
        audioElement.mute = false;
        audioElement.playsinline = true;
        audioElement.srcObject = stream;
        document.body.appendChild(audioElement);
    }

    playAudio(destination.stream)

    const oscillator = audioContext.createOscillator();
    oscillator.type = "square";
    oscillator.frequency.setValueAtTime(440, audioContext.currentTime);
    oscillator.connect(destination);
    oscillator.start();       

    setTimeout(() => {
        oscillator.disconnect(destination);
    }, 5000);
}
````

Click on the body of the webpage. Hear the oscillator sound correctly. Wait 5 seconds, hear distorted audio.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240619/f57dc6cd/attachment.htm>


More information about the webkit-unassigned mailing list