From 303958a80384e396104ee819b58b51e976b68b90 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Wed, 1 May 2024 21:28:16 +1200 Subject: [PATCH] LibWeb: Add BaseAudioContext::nyquist_frequency helper function As a convenient shorthand :^) --- Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h index 75c9f9503ec..7b609b7b9eb 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h +++ b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h @@ -35,6 +35,9 @@ public: double current_time() const { return m_current_time; } Bindings::AudioContextState state() const { return m_control_thread_state; } + // https://webaudio.github.io/web-audio-api/#--nyquist-frequency + float nyquist_frequency() const { return m_sample_rate / 2; } + void set_onstatechange(WebIDL::CallbackType*); WebIDL::CallbackType* onstatechange();