carb::audio::SoundEntry

Defined in carb/audio/IAudioGroup.h

struct SoundEntry

an entry in a table of sounds being added to a sound group on creation or a single sound being added to a sound group with a certain region to be played.

This can be used to provide sound atlas support in a sound group. Each (or some) of the sounds in the group can be the same, but each only plays a small region instead of the full sound.

Public Members

SoundData *sound

the sound data object to add to the sound group.

This must not be nullptr. A reference will be taken to this sound data object when it is added to the group.

uint64_t playStart = 0

the starting point for playback of the new sound.

This value is interpreted in the units specified in playUnits. This should be 0 to indicate the start of the sound data object as the starting point. This may not be larger than the valid data length (in the same units) of the sound data object itself.

uint64_t playLength = 0

the length of data to play in the sound data object.

This extends from the playStart point extending through this much data measured in the units playUnits. This should be 0 to indicate that the remainder of the sound data object starting from playStart should be played.

UnitType playUnits = UnitType::eFrames

the units to interpret the playStart and playLength values in.

Note that using some time units may not provide precise indexing into the sound data object. Also note that specifying this offset in bytes often does not make sense for compressed data.