Sound represents a short audio clip loaded in memory
Use this for sound effects and short audio samples
Constructors
alias(source : Sound) : self
Load sound alias (uses same sample data as original)
Sourcefrom_wave(wave : Wave) : self
Load sound from wave data
Sourceload(filename : String | Path) : self
Load sound from file
Supported formats: WAV, OGG, MP3, FLAC, QOA
SourceClass methods
load(filename : String | Path, &)
Sourceready?(handle : LibRaudio::Sound) : Bool
Check if sound data is ready
SourceInstance methods
pan=(pan : Float32)
Set pan for the sound (0.5 is center)
Sourcepitch=(pitch : Float32)
Set pitch for the sound (1.0 is base level)
Sourceplaying?
Check if sound is currently playing
Sourceready?
Check if this sound is ready
Sourceto_unsafe
Get the underlying C struct
Sourceupdate(data : Pointer(Void), frame_count : Int32)
Update sound buffer with new data
Sourcevolume=(volume : Float32)
Set volume for the sound (1.0 is max level)
Source