mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibWeb/WebAudio: Add renderQuantumSize
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Adds this attribute to BaseAudioContext.idl and adds associated test for OfflineAudioContext. This gives a set value that can be used to start implementing OfflineAudioContext::start_rendering(). Updates idlharness test to account for now implemented renderQuantumSize.
This commit is contained in:
parent
97d7316254
commit
96b142e10b
Notes:
github-actions[bot]
2025-08-20 12:52:14 +00:00
Author: https://github.com/Prospero23
Commit: 96b142e10b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5428
Reviewed-by: https://github.com/gmta ✅
5 changed files with 23 additions and 5 deletions
|
@ -44,6 +44,8 @@ public:
|
|||
static constexpr float MIN_SAMPLE_RATE { 8000 };
|
||||
static constexpr float MAX_SAMPLE_RATE { 192000 };
|
||||
|
||||
static WebIDL::UnsignedLong render_quantum_size() { return s_render_quantum_size; }
|
||||
|
||||
GC::Ref<AudioDestinationNode> destination() const { return *m_destination; }
|
||||
float sample_rate() const { return m_sample_rate; }
|
||||
double current_time() const { return m_current_time; }
|
||||
|
@ -94,6 +96,9 @@ protected:
|
|||
Vector<GC::Ref<WebIDL::Promise>> m_pending_promises;
|
||||
|
||||
private:
|
||||
// https://webaudio.github.io/web-audio-api/#render-quantum-size
|
||||
static constexpr WebIDL::UnsignedLong s_render_quantum_size { 128 };
|
||||
|
||||
void queue_a_decoding_operation(GC::Ref<JS::PromiseCapability>, GC::Root<WebIDL::BufferSource>, GC::Ptr<WebIDL::CallbackType>, GC::Ptr<WebIDL::CallbackType>);
|
||||
|
||||
float m_sample_rate { 0 };
|
||||
|
|
|
@ -26,6 +26,7 @@ interface BaseAudioContext : EventTarget {
|
|||
readonly attribute double currentTime;
|
||||
readonly attribute AudioListener listener;
|
||||
readonly attribute AudioContextState state;
|
||||
readonly attribute unsigned long renderQuantumSize;
|
||||
// FIXME: [SameObject, SecureContext]
|
||||
[FIXME] readonly attribute AudioWorklet audioWorklet;
|
||||
attribute EventHandler onstatechange;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
128
|
|
@ -2,8 +2,8 @@ Harness status: OK
|
|||
|
||||
Found 1147 tests
|
||||
|
||||
879 Pass
|
||||
268 Fail
|
||||
882 Pass
|
||||
265 Fail
|
||||
Fail idl_test setup
|
||||
Pass idl_test validation
|
||||
Pass Partial interface Element: member names are unique
|
||||
|
@ -26,7 +26,7 @@ Pass BaseAudioContext interface: attribute sampleRate
|
|||
Pass BaseAudioContext interface: attribute currentTime
|
||||
Pass BaseAudioContext interface: attribute listener
|
||||
Pass BaseAudioContext interface: attribute state
|
||||
Fail BaseAudioContext interface: attribute renderQuantumSize
|
||||
Pass BaseAudioContext interface: attribute renderQuantumSize
|
||||
Fail BaseAudioContext interface: attribute audioWorklet
|
||||
Pass BaseAudioContext interface: attribute onstatechange
|
||||
Pass BaseAudioContext interface: operation createAnalyser()
|
||||
|
@ -93,7 +93,7 @@ Pass BaseAudioContext interface: context must inherit property "sampleRate" with
|
|||
Pass BaseAudioContext interface: context must inherit property "currentTime" with the proper type
|
||||
Pass BaseAudioContext interface: context must inherit property "listener" with the proper type
|
||||
Pass BaseAudioContext interface: context must inherit property "state" with the proper type
|
||||
Fail BaseAudioContext interface: context must inherit property "renderQuantumSize" with the proper type
|
||||
Pass BaseAudioContext interface: context must inherit property "renderQuantumSize" with the proper type
|
||||
Fail BaseAudioContext interface: context must inherit property "audioWorklet" with the proper type
|
||||
Pass BaseAudioContext interface: context must inherit property "onstatechange" with the proper type
|
||||
Pass BaseAudioContext interface: context must inherit property "createAnalyser()" with the proper type
|
||||
|
@ -154,7 +154,7 @@ Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must
|
|||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "currentTime" with the proper type
|
||||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "listener" with the proper type
|
||||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "state" with the proper type
|
||||
Fail BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "renderQuantumSize" with the proper type
|
||||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "renderQuantumSize" with the proper type
|
||||
Fail BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "audioWorklet" with the proper type
|
||||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "onstatechange" with the proper type
|
||||
Pass BaseAudioContext interface: new OfflineAudioContext(1, 1, sample_rate) must inherit property "createAnalyser()" with the proper type
|
||||
|
|
11
Tests/LibWeb/Text/input/WebAudio/OfflineAudioContext.html
Normal file
11
Tests/LibWeb/Text/input/WebAudio/OfflineAudioContext.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
|
||||
// Once the ctor‑offlineaudiocontext WPT test is updated to check
|
||||
// renderQuantumSize and renderSizeHint, this test is not needed.
|
||||
test(() => {
|
||||
const audioContext = new OfflineAudioContext(1, 1, 44100)
|
||||
println(`${audioContext.renderQuantumSize}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue