Class: AudioStream::Fx::AGain
- Inherits:
-
Object
- Object
- AudioStream::Fx::AGain
- Defined in:
- lib/audio_stream/fx/a_gain.rb
Instance Method Summary collapse
-
#initialize(level:) ⇒ AGain
constructor
A new instance of AGain.
- #process(input) ⇒ Object
Constructor Details
#initialize(level:) ⇒ AGain
Returns a new instance of AGain.
5 6 7 |
# File 'lib/audio_stream/fx/a_gain.rb', line 5 def initialize(level:) @level = Decibel.db(level).mag end |
Instance Method Details
#process(input) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/audio_stream/fx/a_gain.rb', line 9 def process(input) return input if @level==1.0 streams = input.streams.map {|stream| stream * @level } Buffer.new(*streams) end |