carb::audio::fPlaybackModeSimulatePosition

Defined in carb/audio/IAudioPlayback.h

constexpr PlaybackModeFlags carb::audio::fPlaybackModeSimulatePosition = 0x00000400

Flags to indicate the behavior that is used when a simulated voice gets assigned to a bus.

fPlaybackModeSimulatePosition will cause the voice’s playback position to be simulated during update() calls while the voice is not assigned to a bus. When the voice is assigned to a bus, it will begin at that simulated position. For example if a sound had its bus stolen then was assigned to a bus 2 seconds later, the sound would begin playback at the position 2 seconds after the position it was when the bus was stolen. Voices are faded in from silence when the beginning playback part way through to avoid discontinuities. Additionally, voices that have finished playback while in the simulated state will be cleaned up automatically.

fPlaybackModeNoPositionSimulation will cause a simulated voice to begin playing from the start of its sound when it is assigned to a bus. Any voice with this setting will not finish when being simulated unless stopVoice() is called. This is intended for uses cases such as infinitely looping ambient noise (e.g. a burning torch); cases where a sound will not play infinitely may sound strange when this option is used. This option reduces the calculation overhead of update(). This behavior will be used for sounds that are infinitely looping if neither of fPlaybackModeSimulatePosition or fPlaybackModeNoPositionSimulation are specified.

If neither of fPlaybackModeSimulatePosition nor fPlaybackModeNoPositionSimulation are specified, the default behavior will be used. Infinitely looping sounds have the default behavior of fPlaybackModeNoPositionSimulation and sounds with no loop or a finite loop count will use fPlaybackModeSimulatePosition.

When retrieving the playback mode from a playing voice, exactly one of these bits will always be set. Trying to update the playback mode to have both of these bits clear or both of these bits set will result in the previous value of these two bits being preserved in the playback mode.