[Webkit-unassigned] [Bug 257447] New: StereoPannerNode distorts left panned audio
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun May 28 23:44:28 PDT 2023
https://bugs.webkit.org/show_bug.cgi?id=257447
Bug ID: 257447
Summary: StereoPannerNode distorts left panned audio
Product: WebKit
Version: Safari 16
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Audio
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jayboyd at gmail.com
CC: cdumez at apple.com
When I create a StereoPannerNode and pan it to anything less than 0, the audio is very distorted. This happens in both Chrome and Safari on my Mac running Ventura 13.2.1.
The problem is identical if I do new StereoPannerNode() or audioContext.createStereoPanner(), and is identical whether I use a mono or stereo version of the same audio sample. It is also identical wherever I place the stereo panner node in the audio chain.
When I play the audio sample using the OS (right-click from finder and preview), changing the OS pan setting, there is no distortion.
Here's a bit of code:
function playSound(name, volume=1, pan=0, octave=0) {
const buffer = loadedAudio[name];
if (!buffer) {
console.warn('sound buffer not loaded for '+name);
return;
}
if (audioCtx.state === 'suspended') {
return;
}
const source = audioCtx.createBufferSource();
const gainNode = audioCtx.createGain();
// const panNode = new StereoPannerNode(audioCtx, {pan: pan});
const panNode = audioCtx.createStereoPanner();
source.buffer = buffer;
const note = Math.floor(Math.random() * NOTES.length);
const pitch = Math.pow(2, octave) * NOTES[note];
source.playbackRate.value = pitch;
panNode.pan.value = pan;
gainNode.gain.value = volume;
source.connect(gainNode);
gainNode.connect(panNode);
panNode.connect(audioCtx.destination);
source.start(0);
}
--
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/20230529/e8a82eb0/attachment-0001.htm>
More information about the webkit-unassigned
mailing list