class
Raudio::Wave
- Raudio::Wave
- Reference
- Object
Overview
Wave represents raw audio data Use this for loading and manipulating audio waveforms
Defined in:
raudio/wave.crConstructors
-
.load(filename : String | Path) : self
Load wave data from file Supported formats: WAV, OGG, MP3, FLAC, QOA
-
.load_from_memory(file_type : String, data : Bytes) : self
Load wave from memory buffer
Class Method Summary
- .load(filename : String | Path, &)
-
.ready?(handle : LibRaudio::Wave) : Bool
Check if wave data is ready
-
.unload_samples(samples : Slice(Float32))
Unload wave samples data Only call this on samples returned by
#load_samples
Instance Method Summary
-
#channels : UInt32
Number of channels
- #close
-
#copy : Wave
Copy wave data
-
#crop(init_sample : Int32, final_sample : Int32)
Crop wave data to specified samples range
-
#export(filename : String) : Bool
Export wave data to file
-
#export_as_code(filename : String) : Bool
Export wave data as code (.h)
- #finalize
-
#format(sample_rate : Int32, sample_size : Int32, channels : Int32)
Convert wave data to desired format
-
#frame_count : UInt32
Frame count
-
#load_samples : Slice(Float32)
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 -
#ready? : Bool
Check if this wave is ready
- #release
- #released? : Bool
-
#sample_rate : UInt32
Sample rate
-
#sample_size : UInt32
Sample size (bit depth)
-
#to_unsafe : Raudio::LibRaudio::Wave
Get the underlying C struct
Constructor Detail
Load wave data from file Supported formats: WAV, OGG, MP3, FLAC, QOA
Class Method Detail
Unload wave samples data
Only call this on samples returned by #load_samples
Instance Method Detail
Convert wave data to desired format
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