소스 검색

LibWeb: Add BaseAudioContext::nyquist_frequency helper function

As a convenient shorthand :^)
Shannon Booth 1 년 전
부모
커밋
303958a803
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.h

+ 3 - 0
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();