otc_audio_device_callbacks
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.
Properties
| Name | Type | Description |
|---|---|---|
user_data |
void * | A pointer to data you set related to the audio device. |
reserved |
void * | A void pointer to a memory area holding reserved resources used for the internal implementation. |
Callbacks
| Name | Description |
|---|---|
init(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to initialize itself. |
destroy(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to be destroyed. |
init_capturer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio capturer for the audio device to be initialized. |
destroy_capturer(audio_device, user_data) → {otc_bool} |
Called when the SDK is done capturing audio and it is time to destroy the audio capturer for the audio device. |
start_capturer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to start capturing audio samples. |
stop_capturer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio capturer for the audio device to stop sampling audio. |
is_capturer_initialized(audio_device, user_data) → {otc_bool} |
Whether the device has initialized itself for audio sampling. |
is_capturer_started(audio_device, user_data) → {otc_bool} |
Whether the device has started audio sampling. |
get_estimated_capture_delay(audio_device, user_data) → {int} |
Called when the SDK requests the estimated capturing delay for the audio device, in ms. |
get_capture_settings(audio_device, user_data, settings) → {otc_bool} |
Called when the SDK requests the audio capture settings used by the audio device. |
init_renderer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to initialize itself for audio rendering. |
destroy_renderer(audio_device, user_data) → {otc_bool} |
Called when the SDK is done rendering audio and it is time to destroy the audio renderer for the audio device. |
start_renderer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to start rendering audio. |
stop_renderer(audio_device, user_data) → {otc_bool} |
Called when the SDK requests the audio device to stop rendering audio. |
is_renderer_initialized(audio_device, user_data) → {otc_bool} |
Whether the device has been initialized for audio rendering. |
is_renderer_started(audio_device, user_data) → {otc_bool} |
Whether the device started audio rendering. |
get_estimated_render_delay(audio_device, user_data) → {int} |
Called when the SDK requests the estimated rendering delay for the audio device, in ms. |
get_render_settings(audio_device, user_data, settings) → {otc_bool} |
Called when the SDK requests the audio rendering settings used by the device. |
init(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to initialize itself.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
destroy(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to be destroyed.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
init_capturer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio capturer for the audio device to be initialized.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
destroy_capturer(audio_device, user_data) → {otc_bool}
Called when the SDK is done capturing audio and it is time to destroy the audio capturer for the audio device.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
start_capturer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to start capturing audio samples.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
stop_capturer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio capturer for the audio device to stop sampling audio.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
is_capturer_initialized(audio_device, user_data) → {otc_bool}
Whether the device has initialized itself for audio sampling.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating whether the device is initialized or not.
is_capturer_started(audio_device, user_data) → {otc_bool}
Whether the device has started audio sampling.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating whether it is started or not.
get_estimated_capture_delay(audio_device, user_data) → {int}
Called when the SDK requests the estimated capturing delay for the audio device, in ms.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
Returns:
The estimated capturing delay in ms.
get_capture_settings(audio_device, user_data, settings) → {otc_bool}
Called when the SDK requests the audio capture settings used by the audio device.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
settings |
struct otc_audio_device_settings * | A pointer to a struct holding the settings. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
init_renderer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to initialize itself for audio rendering.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
destroy_renderer(audio_device, user_data) → {otc_bool}
Called when the SDK is done rendering audio and it is time to destroy the audio renderer for the audio device.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
start_renderer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to start rendering audio.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
stop_renderer(audio_device, user_data) → {otc_bool}
Called when the SDK requests the audio device to stop rendering audio.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.
is_renderer_initialized(audio_device, user_data) → {otc_bool}
Whether the device has been initialized for audio rendering.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating whether it is initialized or not.
is_renderer_started(audio_device, user_data) → {otc_bool}
Whether the device started audio rendering.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
See: : - otc_bool
Returns:
Boolean value indicating whether it is started or not.
get_estimated_render_delay(audio_device, user_data) → {int}
Called when the SDK requests the estimated rendering delay for the audio device, in ms.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
Returns:
The estimated rendering delay in ms.
get_render_settings(audio_device, user_data, settings) → {otc_bool}
Called when the SDK requests the audio rendering settings used by the device.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_device |
const otc_audio_device * | A pointer to the audio device instance. |
user_data |
void * | A pointer to the user_data you set for the audio device. |
settings |
struct otc_audio_device_settings * | A pointer to a struct holding the settings. |
See: : - otc_bool
Returns:
Boolean value indicating either error or success.