class

Raudio::Wave

Inherits Reference < Object

Wave represents raw audio data Use this for loading and manipulating audio waveforms

Constructors

load(filename : String | Path) : self

Load wave data from file Supported formats: WAV, OGG, MP3, FLAC, QOA

Source
load_from_memory(file_type : String, data : Bytes) : self

Load wave from memory buffer

Source

Class methods

load(filename : String | Path, &)
Source
ready?(handle : LibRaudio::Wave) : Bool

Check if wave data is ready

Source
unload_samples(samples : Slice(Float32))

Unload wave samples data Only call this on samples returned by load_samples

Source

Instance methods

channels

Number of channels

Source
close
Source
copy

Copy wave data

Source
crop(init_sample : Int32, final_sample : Int32)

Crop wave data to specified samples range

Source
export(filename : String) : Bool

Export wave data to file

Source
export_as_code(filename : String) : Bool

Export wave data as code (.h)

Source
finalize
Source
format(sample_rate : Int32, sample_size : Int32, channels : Int32)

Convert wave data to desired format

Source
frame_count

Frame count

Source
load_samples

Load wave samples as a floats array Returns a Slice of Float32 containing the sample data Note: You must manually call unload_samples on the returned pointer when done

Source
ready?

Check if this wave is ready

Source
release
Source
released?
Source
sample_rate

Sample rate

Source
sample_size

Sample size (bit depth)

Source
to_unsafe

Get the underlying C struct

Source