RaylibAudioModuleBase<R extends RaylibBase, AudioStreamStructType extends AudioStreamBase<AudioStreamStructType>, MusicStructType extends MusicBase<MusicStructType, AudioStreamStructType>, SoundStructType extends SoundBase<SoundStructType, AudioStreamStructType>, WaveStructType extends WaveBase<WaveStructType>, AudioCallbackType extends AudioCallbackBase> class abstract

Backend-agnostic contract for the Raylib Audio module.

Concrete platform implementations mix in or extend this to provide the full Core API surface across different backends.

Inheritance

Constructors

RaylibAudioModuleBase(R rl)

Properties

hashCode int
The hash code for this object.
no setterinherited
RaylibCaptureIds RaylibAudioModuleCaptureIds
Capture ID generator for pointer slots allocated by this module.
final
RaylibDebugLabels RaylibAudioModuleDebugLabels
Debug label generator for this module's function calls.
final
rl → R
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

AttachAudioMixedProcessor(AudioCallbackType callback) → void
Attach audio stream processor to the entire audio pipeline, receives the samples as 'float'
AttachAudioStreamProcessor(AudioStreamStructType stream, AudioCallbackType callback) → void
Attach audio stream processor to stream, receives the samples as 'float'
CloseAudioDevice() → void
Close the audio device and context
debug(bool v) → void
Enables or disables debug logging for this module.
inherited
debugError(String message) → void
Logs message at error level if debug is enabled and message passes all filters.
inherited
debugFilter(bool filter(String)) → void
Adds a predicate that gates debug output. Only messages satisfying at least one filter are logged.
inherited
debugInfo(String message) → void
Logs message at info level if debug is enabled and message passes all filters.
inherited
debugTime(bool v) → void
Enables or disables per-call timing output alongside debug logs.
inherited
debugWarn(String message) → void
Logs message at warn level if debug is enabled and message passes all filters.
inherited
DetachAudioMixedProcessor(AudioCallbackType callback, {bool keepAlive = false}) → void
Detach audio stream processor from the entire audio pipeline
DetachAudioStreamProcessor(AudioStreamStructType stream, AudioCallbackType callback, {bool keepAlive = false}) → void
Detach audio stream processor from stream
disableSync<T>(T f()) → T
Executes f with RaylibTempBase syncing temporarily disabled, restoring the previous sync state afterward.
inherited
dispose() → void
Calls all registered onDispose callbacks and clears them.
inherited
doLoad() → void
Ensures load is called exactly once, regardless of how many times doLoad is invoked.
inherited
ExportWave(WaveStructType wave, String fileName) bool
Export wave data to file, returns true on success
ExportWaveAsCode(WaveStructType wave, String fileName) bool
Export wave sample data to code (.h), returns true on success
GetMasterVolume() double
Get master volume (listener)
GetMusicTimeLength(MusicStructType music) double
Get music time length (in seconds)
GetMusicTimePlayed(MusicStructType music) double
Get current music time played (in seconds)
InitAudioDevice() → void
Initialize audio device and context
IsAudioDeviceReady() bool
Check if audio device has been initialized successfully
IsAudioStreamPlaying(AudioStreamStructType stream) bool
Check if audio stream is playing
IsAudioStreamProcessed(AudioStreamStructType stream) bool
Check if any audio stream buffers requires refill
IsAudioStreamValid(AudioStreamStructType stream) bool
Checks if an audio stream is valid (buffers initialized)
IsMusicStreamPlaying(MusicStructType music) bool
Check if music is playing
IsMusicValid(MusicStructType music) bool
Checks if a music stream is valid (context and buffers initialized)
IsSoundPlaying(SoundStructType sound) bool
Check if a sound is currently playing
IsSoundValid(SoundStructType sound) bool
Checks if a sound is valid (data loaded and buffers initialized)
IsWaveValid(WaveStructType wave) bool
Checks if wave data is valid (data loaded and parameters)
load() → void
Override to perform one-time module initialization. Called by doLoad.
inherited
LoadAudioStream(num sampleRate, num sampleSize, num channels) → AudioStreamStructType
Load audio stream (to stream raw audio pcm data)
LoadMusicStream(String fileName) → MusicStructType
Load music stream from file
LoadMusicStreamFromMemory(String fileType, Uint8List data) → MusicStructType
Load music stream from data
LoadSound(String fileName) → SoundStructType
Load sound from file
LoadSoundAlias(SoundStructType source) → SoundStructType
Create a new sound that shares the same sample data as the source sound, does not own the sound data
LoadSoundFromWave(WaveStructType wave) → SoundStructType
Load sound from wave data
LoadWave(String fileName) → WaveStructType
Load wave data from file
LoadWaveFromMemory(String fileType, Uint8List fileData) → WaveStructType
Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
LoadWaveSamples(WaveStructType wave) List<double>
Load samples data from wave as a 32bit float data array
logError(Object? message) → void
inherited
logInfo(Object? message) → void
inherited
logWarn(Object? message) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose(void fn()) → void
Registers fn to be called when this module is disposed.
inherited
PauseAudioStream(AudioStreamStructType stream) → void
Pause audio stream
PauseMusicStream(MusicStructType music) → void
Pause music playing
PauseSound(SoundStructType sound) → void
Pause a sound
PlayAudioStream(AudioStreamStructType stream) → void
Play audio stream
PlayMusicStream(MusicStructType music) → void
Start music playing
PlaySound(SoundStructType sound) → void
Play a sound
ResumeAudioStream(AudioStreamStructType stream) → void
Resume audio stream
ResumeMusicStream(MusicStructType music) → void
Resume playing paused music
ResumeSound(SoundStructType sound) → void
Resume a paused sound
run<T>(String name(), T f()) → T
Executes f, logging its label (and optionally timing it) when debug is enabled and the label passes all filters.
inherited
SeekMusicStream(MusicStructType music, num position) → void
Seek music to a position (in seconds)
SetAudioStreamBufferSizeDefault(num size) → void
Default size for new audio streams
SetAudioStreamCallback(AudioStreamStructType stream, AudioCallbackType callback) → void
Audio thread callback to request new data
SetAudioStreamPan(AudioStreamStructType stream, num pan) → void
Set pan for audio stream (0.5 is centered)
SetAudioStreamPitch(AudioStreamStructType stream, num pitch) → void
Set pitch for audio stream (1.0 is base level)
SetAudioStreamVolume(AudioStreamStructType stream, num volume) → void
Set volume for audio stream (1.0 is max level)
SetMasterVolume(num volume) → void
Set master volume (listener)
SetMusicPan(MusicStructType music, num pan) → void
Set pan for a music (0.5 is center)
SetMusicPitch(MusicStructType music, num pitch) → void
Set pitch for a music (1.0 is base level)
SetMusicVolume(MusicStructType music, num volume) → void
Set volume for music (1.0 is max level)
SetSoundPan(SoundStructType sound, num pan) → void
Set pan for a sound (0.5 is center)
SetSoundPitch(SoundStructType sound, num pitch) → void
Set pitch for a sound (1.0 is base level)
SetSoundVolume(SoundStructType sound, num volume) → void
Set volume for a sound (1.0 is max level)
StopAudioStream(AudioStreamStructType stream) → void
Stop audio stream
StopMusicStream(MusicStructType music) → void
Stop music playing
StopSound(SoundStructType sound) → void
Stop playing a sound
toString() String
A string representation of this object.
inherited
UnloadAudioStream(AudioStreamStructType stream) → void
Unload audio stream and free memory
UnloadMusicStream(MusicStructType music) → void
Unload music stream
UnloadSound(SoundStructType sound) → void
Unload sound
UnloadSoundAlias(SoundStructType alias) → void
Unload a sound alias (does not deallocate sample data)
UnloadWave(WaveStructType wave) → void
Unload wave data
UpdateAudioStream(AudioStreamStructType stream, TypedDataList data) → void
Update audio stream buffers with data
UpdateMusicStream(MusicStructType music) → void
Updates buffers for music streaming
UpdateSound(SoundStructType sound, TypedDataList data, num sampleCount) → void
Update sound buffer with new data
WaveCopy(WaveStructType wave) → WaveStructType
Copy a wave to a new wave
WaveCrop(WaveStructType wave, num initFrame, num finalFrame) → void
Crop a wave to defined frames range
WaveFormat(WaveStructType wave, num sampleRate, num sampleSize, num channels) → void
Convert wave data to desired format

Operators

operator ==(Object other) bool
The equality operator.
inherited