LibWeb/WebAudio: Implement basic startRendering

Adds passing WPT. Does not handle actually rendering audio yet.
This commit is contained in:
Ben Eidson
2025-10-22 10:51:31 -04:00
committed by Jelle Raaijmakers
parent 5abb5d555a
commit 01947ded23
Notes: github-actions[bot] 2025-10-26 13:20:28 +00:00
6 changed files with 143 additions and 8 deletions

View File

@@ -1,11 +1,22 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
// Once the ctorofflineaudiocontext WPT test is updated to check
// renderQuantumSize and renderSizeHint, this test is not needed.
test(() => {
asyncTest(async done => {
// Once the ctorofflineaudiocontext WPT test is updated to check
// renderQuantumSize and renderSizeHint, this test is not needed.
const audioContext = new OfflineAudioContext(1, 1, 44100)
println(`${audioContext.renderQuantumSize}`);
// Second call must reject with InvalidStateError
await audioContext.startRendering();
try {
await audioContext.startRendering();
println('FAIL: started rendering on repeated call');
} catch (e) {
println(`${e}`);
}
done();
});
</script>