#include <audio_device.h>
This structure includes a set of function pointers to callback functions to use with an audio device. The SDK calls these functions when events related to the audio device occur.
All callbacks will not be made on the application or main thread but on an internal thread. The application should return the callback as quickly as possible to avoid blocking the internal thread.
In addition to the callbacks, the struct includes a user_data pointer, which points data you can set related to the audio device.
otc_bool(* destroy) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to be destroyed.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* destroy_capturer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK is done capturing audio and it is time to destroy the audio capturer for the audio device.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* destroy_renderer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK is done rendering audio and it is time to destroy the audio renderer for the audio device.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* get_capture_settings) (const otc_audio_device *audio_device, void *user_data, struct otc_audio_device_settings *settings) |
Called when the SDK requests the audio capture settings used by the audio device.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
settings | A pointer to a struct holding the settings. |
int(* get_estimated_capture_delay) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the estimated capturing delay for the audio device, in ms.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
int(* get_estimated_render_delay) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the estimated rendering delay for the audio device, in ms.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* get_render_settings) (const otc_audio_device *audio_device, void *user_data, struct otc_audio_device_settings *settings) |
Called when the SDK requests the audio rendering settings used by the device.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
settings | A pointer to a struct holding the settings. |
otc_bool(* init) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to initialize itself.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* init_capturer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio capturer for the audio device to be initialized.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* init_renderer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to initialize itself for audio rendering.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* is_capturer_initialized) (const otc_audio_device *audio_device, void *user_data) |
Whether the device has initialized itself for audio sampling.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* is_capturer_started) (const otc_audio_device *audio_device, void *user_data) |
Whether the device has started audio sampling.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* is_renderer_initialized) (const otc_audio_device *audio_device, void *user_data) |
Whether the device has been initialized for audio rendering.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* is_renderer_started) (const otc_audio_device *audio_device, void *user_data) |
Whether the device started audio rendering.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
void* reserved |
A void pointer to a memory area holding reserved resources used for the internal implementation.
otc_bool(* start_capturer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to start capturing audio samples.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* start_renderer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to start rendering audio.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* stop_capturer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio capturer for the audio device to stop sampling audio.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
otc_bool(* stop_renderer) (const otc_audio_device *audio_device, void *user_data) |
Called when the SDK requests the audio device to stop rendering audio.
audio_device | A pointer to the audio device instance. |
user_data | A pointer to the user_data you set for the audio device. |
void* user_data |
A pointer to data you set related to the audio device.