Defined in omni/audio/experimental/IAudioCapture.h

using omni::audio::experimental::CaptureInfoCallback = void (*)(ICaptureStream *stream, CaptureInfoType type, const CaptureInfoData *data, void *context)

A callback that’s used to signal capture stream events.


This callback is used to signal various events that a capture stream can encounter. Overrun events indicate that data from the capture stream has been lost. The callee should do whatever is appropriate to handle this situation (e.g. toggle a warning indicator on the UI). Device lost events indicate that an unrecoverable issue has occurred with the audio device (such as it being unplugged) and capture cannot continue.


This callback executes from its own thread, so thread safety will need to be considered. This is called on the same thread as CaptureDataCallback, so these two calls can access the same data without concurrency issues.


Similarly to CaptureDataCallback, this callback should return as quickly as possible to avoid causing overruns. After an overrun has occurred, the device will be restarted immediately, so this callback taking too long could result in another overrun callback happening immediately after your callback returns.

Param stream

[inout] The stream that this callback was fired from.

Param type

[in] What type of event occurred.

Param data

[in] Data related to this error.

Param context

[inout] The user-specified callback data.