class Eagle::AudioBuffer

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.cr

Constructors

Instance Method Summary

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.


def channels : Int32 #

1 for mono, 2 for stereo.


def duration : Float32 #

Length in seconds.


def frames : Int32 #

Number of frames, where one frame holds one sample per channel.


def sample_rate : Int32 #

Samples per second per channel, such as 44100 or 48000.


def samples : Slice(Float32) #

The interleaved samples: left, right, left, right for stereo.