[Webkit-unassigned] [Bug 244667] New: Volume of an Audio object cannot be changed when AudioContext is created
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 1 07:36:19 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=244667
Bug ID: 244667
Summary: Volume of an Audio object cannot be changed when
AudioContext is created
Product: WebKit
Version: Safari 15
Hardware: Mac (Apple Silicon)
OS: macOS 12
Status: NEW
Severity: Major
Priority: P2
Component: Web Audio
Assignee: webkit-unassigned at lists.webkit.org
Reporter: aerdogan07 at gmail.com
CC: cdumez at apple.com
Reproduction Steps:
- Create an audio object
- Create AudioContext with createMediaElementSource for the audio object before it's played
- Play the audio
- Adjust the audio's volume programmatically
Expected:
The level of volume changes accordingly.
Observed:
The level of volume doesn't change.
Demo: https://codesandbox.io/s/ecstatic-tom-8tz5em
Code to reproduce the issue:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Static Template</title>
</head>
<body>
<button id="audio-control">Play Audio</button>
</body>
<script type="application/javascript">
const audio = new Audio(
"https://upload.wikimedia.org/wikipedia/commons/b/bb/Test_ogg_mp3_48kbps.wav"
);
audio.crossOrigin = "anonymous";
audio.loop = true;
audio.volume = 0.5;
const audioContext = new AudioContext();
const button = document.querySelector("#audio-control");
button.addEventListener("click", () => {
if (audio.paused) {
button.innerText = "Change Volume Level";
const audioSource = audioContext.createMediaElementSource(audio);
const audioDestination = audioContext.createMediaStreamDestination();
audioSource.connect(audioContext.destination);
audioSource.connect(audioDestination);
audio.play();
return;
}
let newVolumeLevel = audio.volume + 0.5;
if (newVolumeLevel > 1) {
newVolumeLevel = 0;
}
audio.volume = newVolumeLevel;
});
</script>
</html>
--
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/20220901/898d58b7/attachment.htm>
More information about the webkit-unassigned
mailing list