Class: RubyAudio::Buffer
- Includes:
- Enumerable
- Defined in:
- lib/ruby-audio/buffer.rb
Overview
The Buffer
class contains sound data read out of the sound. It can store a fixed maximum number of multi-channel audio frames of a specifi data type. Valid types are short
, int
, float
, and double
. The channel count must match up to the channel count of the sounds being read and written to. Trying to read into a buffer with the wrong number of channels will result in an error.
Example:
buf = RubyAudio::Buffer.float(1000)
buf = RubyAudio::Buffer.new("float", 1000, 1)
Instance Method Summary collapse
Methods inherited from CBuffer
#[], #[]=, #channels, #initialize, #initialize_copy, #real_size, #real_size=, #size, #type
Constructor Details
This class inherits a constructor from RubyAudio::CBuffer
Instance Method Details
#each ⇒ Object
15 16 17 18 19 |
# File 'lib/ruby-audio/buffer.rb', line 15 def each self.size.times do |i| yield self[i] end end |