GCubeSDK
©2026 FenixFox®Studios

AudioBuffer

Audio data loaded from a file AudioLoader returns this object. Assign it to Audio or AudioEmitter with setBuffer before you call play. It is a 32-bit aligned buffer.

Methods

AudioBuffer()

Default constructor - creates an empty audio buffer

AudioBuffer(const void* source, u32 byteSize, AudioFormat audioFormat)

Constructs a buffer by copying sample bytes

source Pointer to sample bytes
byteSize Size of the sample data
audioFormat Source container format [AudioFormat](./enums.html#audioformat)::Empty

AudioBuffer* clone() const

Creates a copy of this audio buffer

void copy(const AudioBuffer& other)

Copies properties and samples from another audio buffer

other Source audio buffer

Properties

isAudioBuffer bool Read
format AudioFormat Container format (WAV)
url string Source path used by AudioLoader
size u32 Sample size in bytes
data const void * Pointer to 16
duration f32 Duration in seconds (0 when unknown)
sampleRate u32 Sample rate in Hz
channels u32 Channel count (1 = mono, 2 = stereo)