carb::audio::ProbabilityDesc

Defined in carb/audio/IAudioGroup.h

struct ProbabilityDesc

descriptor for specifying the relative probabilities for choosing one or more sounds in a sound group.

This allows the probabilities for a sound within a group being chosen at play time. By default, a sound group assigns equal probabilities to all of its members.

Public Members

size_t index

set to the index of the sound within the group to change the probability for.

This may either be kGroupIndexAll to change all probabilities within the group, or the zero based index of the single sound to change. When kGroupIndexAll is used, the probability value is ignored since a uniform distribution will always be set for each sound in the group. If this index is outside of the range of the number of sounds in the group, this call will silently fail.

float probability

the new relative probability value to set for the specified sound in the group.

This value will be ignored if the index value is kGroupIndexAll however. This value does not need to be within any given range. This simply specifies the relative frequency of the specified sound being selected compared to other sounds in the group. Setting this to 0 will cause the sound to never be selected from the group.

void *ext = nullptr

value reserved for future expansion.

This should be set to nullptr.