carb::audio::fPlayFlagRealtimeCallbacks
Defined in carb/audio/IAudioPlayback.h
-
constexpr PlayFlags carb::audio::fPlayFlagRealtimeCallbacks = 0x00000002
when set, this indicates that voice event callbacks will be performed on the engine thread immediately when the event occurs instead of queuing it to be performed in a later call to update() on the host app thread.
This flag is useful for streaming sounds or sounds that have data dynamically written to them. This allows for a lower latency callback system. If the callback is performed on the engine thread, it must complete as quickly as possible and not perform any operations that may block (ie: read from a file, wait on a signal, use a high contention lock, etc). If the callback takes too long, it will cause the engine cycle to go over time and introduce an artifact or audio dropout into the stream. In general, if a real-time callback takes more than ~1ms to execute, there is a very high possibility that it could cause an audio dropout. If this flag is not set, all callback events will be queued when they occur and will not be called until the next call to update() on the context object.