class
Eagle::AudioBuffer
- Eagle::AudioBuffer
- Reference
- Object
Overview
Decoded audio in memory: interleaved Float32 samples from -1 to 1.
A Sound wraps one. You deal with buffers directly only when generating or analyzing
audio sample by sample.
Defined in:
eagle/audio/audio.crConstructors
-
.new(sample_rate : Int32, channels : Int32, samples : Slice(Float32))
Wraps existing samples.
Instance Method Summary
-
#at(frame : Int32, channel : Int32) : Float32
The sample for channel at frame, with frame clamped to the buffer.
-
#channels : Int32
1 for mono, 2 for stereo.
-
#duration : Float32
Length in seconds.
-
#frames : Int32
Number of frames, where one frame holds one sample per channel.
-
#sample_rate : Int32
Samples per second per channel, such as 44100 or 48000.
-
#samples : Slice(Float32)
The interleaved samples: left, right, left, right for stereo.
Constructor Detail
def self.new(sample_rate : Int32, channels : Int32, samples : Slice(Float32))
#
Wraps existing samples.
Instance Method Detail
def at(frame : Int32, channel : Int32) : Float32
#
The sample for channel at frame, with frame clamped to the buffer.