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 8 9 10 11 |
# File 'lib/audio_stream/fx/a_gain.rb', line 5 def initialize(level:) if Decibel===level @level = level.mag else @level = Decibel.db(level).mag end end |
Instance Method Details
#process(input) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/audio_stream/fx/a_gain.rb', line 13 def process(input) return input if @level==1.0 streams = input.streams.map {|stream| stream * @level } Buffer.new(*streams) end |