class

MinAudio::AudioBuffer

Inherits Reference < Object

Constructors

from_file(path : String) : self

Decode a file from disk (WAV/MP3/FLAC — whatever the vendored miniaudio builds decode; Vorbis is off by default). Raises MinAudio::Error on unreadable/undecodable input.

Source
from_memory(data : Bytes) : self

Decode an in-memory file image (Bytes, e.g. an asset embedded in the binary).

Source
new(handle : Pointer(Void))

Internal: wrap an opaque C-side buffer (the constructors above).

Source

Instance methods

channels
Source
close

Free the decoded PCM. Idempotent — but every Sound playing through this buffer must be stopped/closed first (a live Sound reading freed memory would crash the audio thread).

Source
closed?
Source
finalize
Source
frames

Total frames (a frame = one sample per channel).

Source
sample_rate
Source
to_unsafe

Internal: the ma_audio_buffer pointer (Sound init).

Source