carb::audio::VoiceCallbackType

Defined in carb/audio/IAudioPlayback.h

enum class carb::audio::VoiceCallbackType

voice callback reason names.

These identify what kind of callback is being performed. This can either be an event point or the end of the sound.

Values:

enumerator eSoundEnded

the sound reached its end and has implicitly stopped.

This will not be hit for looping sounds until the last loop iteration completes and the sound stops playing. In the voice callback for this type, the data parameter will be set to nullptr.

enumerator eEventPoint

the engine has reached one of the playing sound’s event points.

These are arbitrary points within the sound that need notification so that other objects in the simulation can react to the sound. These event points are often chosen by the sound designers. In the voice callback for this type, the data parameter will be set to the event point object that was triggered.

enumerator eLoopPoint

the engine has reached a loop point.

This callback occurs when the new loop iteration starts. This will only be triggered on voices that have the fPlayFlagRealtimeCallbacks flag set. On streaming sounds, these callbacks are triggered when the buffer containing a loop end has finished playing, rather than when the loop end is decoded. This is not guaranteed to be called exactly on the ending frame of the loop. If an excessively short loop (e.g. 2ms) is put on a streaming sound, some loop callbacks may be skipped.