Class: Browser::Audio::Node::BiquadFilter

Inherits:
Base show all
Defined in:
opal/browser/audio/node.rb

Constant Summary collapse

TYPES =
%i(lowpass highpass bandpass lowshelf highshelf peaking notch allpass)

Instance Method Summary collapse

Methods inherited from Base

#connect, #disconnect, #method_missing, #respond_to_missing?

Constructor Details

#initialize(audio_context) ⇒ BiquadFilter

Returns a new instance of BiquadFilter.



96
97
98
# File 'opal/browser/audio/node.rb', line 96

def initialize(audio_context)
  super `#{audio_context.to_n}.createBiquadFilter()`
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Browser::Audio::Node::Base

Instance Method Details

#typeObject



108
109
110
# File 'opal/browser/audio/node.rb', line 108

def type
  `#@native.type`
end

#type=(type) ⇒ Object



100
101
102
103
104
105
106
# File 'opal/browser/audio/node.rb', line 100

def type=(type)
  unless TYPES.include?(type)
    raise ArgumentError, "type #{type} doesn't exists"
  end

  `#@native.type =  type`
end