Class BiquadFilterNode

java.lang.Object
com.codename1.media.audio.AudioNode
com.codename1.media.audio.BiquadFilterNode

public final class BiquadFilterNode extends AudioNode
A second order filter, the Web Audio BiquadFilterNode: low and high pass, band pass, shelves, peaking, notch and all pass. Coefficients follow the specification's formulas and are recomputed per sample only while a parameter changes. The output has the input's channel count.
  • Method Details

    • getFrequency

      public AudioParam getFrequency()

      The cutoff or center frequency in Hz, 350 by default.

      Returns

      the parameter

    • getDetune

      public AudioParam getDetune()

      A detune of the frequency in cents, 0 by default.

      Returns

      the parameter

    • getQ

      public AudioParam getQ()

      The quality factor, 1 by default: resonance in dB for low and high pass, width for band pass, peaking, notch and all pass. Unused by the shelves.

      Returns

      the parameter

    • getGain

      public AudioParam getGain()

      The boost in dB for the shelves and peaking, 0 by default.

      Returns

      the parameter

    • getType

      public BiquadFilterType getType()

      The filter type.

      Returns

      the type

    • setType

      public void setType(BiquadFilterType type)

      Sets the filter type.

      Parameters
      • type: the type
    • getFrequencyResponse

      public void getFrequencyResponse(float[] frequencyHz, float[] magResponse, float[] phaseResponse)

      Computes the response of the filter, with the parameters' current values, at each of frequencyHz.

      Parameters
      • frequencyHz: the frequencies to evaluate

      • magResponse: receives the linear magnitude at each frequency

      • phaseResponse: receives the phase in radians at each frequency