carb::audio::ContextCallbackEvent

Defined in carb/audio/IAudioPlayback.h

enum class carb::audio::ContextCallbackEvent

names for events that get passed to a context callback function.

Values:

enumerator eDeviceChange

an audio device in the system has changed its state.

This could mean that one or more devices were either added to or removed from the system. Since device change events are inherently asynchronous and multiple events can occur simultaneously, this callback does not provide any additional information except that the event itself occurred. It is the host app’s responsibility to enumerate devices again and decide what to do with the event. This event will only occur for output audio devices in the system. With this event, the data parameter to the callback will be nullptr. This callback will always be performed during the context’s update() call.

enumerator eCycleStart

the audio engine is about to start a processing cycle.

This will occur in the audio engine thread. This is given as an opportunity to update any voice parameters in a manner that can always be completed immediately and will be synchronized with other voice parameter changes made at the same time. Since this occurs in the engine thread, it is the caller’s responsibility to ensure this callback returns as quickly as possible so that it does not interrupt the audio processing timing. If this callback takes too long to execute, it will cause audio drop-outs. The callback’s data parameter will be set to nullptr for this event.

enumerator eCycleEnd

the audio engine has just finished a processing cycle.

This will occur in the audio engine thread. Voice operations performed in here will take effect immediately. Since this occurs in the engine thread, it is the caller’s responsibility to ensure this callback returns as quickly as possible so that it does not interrupt the audio processing timing. If this callback takes too long to execute, it will cause audio drop-outs. The callback’s data parameter will be set to nullptr for this event.