OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IIRDSPKernel_h |
| 6 #define IIRDSPKernel_h |
| 7 |
| 8 #include "modules/webaudio/IIRProcessor.h" |
| 9 #include "platform/audio/AudioDSPKernel.h" |
| 10 #include "platform/audio/IIRFilter.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class IIRProcessor; |
| 15 |
| 16 class IIRDSPKernel final : public AudioDSPKernel { |
| 17 public: |
| 18 explicit IIRDSPKernel(IIRProcessor* processor) |
| 19 : AudioDSPKernel(processor) |
| 20 , m_iir(processor->feedforward(), processor->feedback()) |
| 21 { |
| 22 } |
| 23 |
| 24 // AudioDSPKernel |
| 25 void process(const float* source, float* dest, size_t framesToProcess) overr
ide; |
| 26 void reset() override { m_iir.reset(); } |
| 27 |
| 28 // Get the magnitude and phase response of the filter at the given |
| 29 // set of frequencies (in Hz). The phase response is in radians. |
| 30 void getFrequencyResponse(int nFrequencies, const float* frequencyHz, float*
magResponse, float* phaseResponse); |
| 31 |
| 32 double tailTime() const override; |
| 33 double latencyTime() const override; |
| 34 |
| 35 protected: |
| 36 IIRFilter m_iir; |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // IIRDSPKernel_h |
OLD | NEW |