Documentation

Support

Vivox Core SDK

Vivox Core SDK

include/VxcTypes.h

Reference the Vivox Core SDK API.
Read time 8 minutesLast updated 11 days ago

Classes

Name

structvx_before_recv_audio_mixed_participant_data_t
A struct that holds per-participant data for a callback.
structvx_sdk_config
Configuration options that are passed to [vx_initialize3()].

Types

Name

enumvx_log_level { log_none = -1, log_error = 0, log_warning = 1, log_info = 2, log_debug = 3, log_trace = 4, log_all = 5}
SDK logging levels.
enumvx_backend_type { backend_type_unknown = -1, backend_type_sip = 0, backend_type_xmpp = 1}
Values for the backend type.
enumvx_udp_frame_type { vx_frame_type_rtp = 0, vx_frame_type_rtcp = 1, vx_frame_type_sip_message = 2, vx_frame_type_sip_keepalive = 3}
Values for the UDP packet type.
enumvx_bluetooth_profile { vx_bluetooth_profile_a2dp = 0, vx_bluetooth_profile_hfp = 1}
typedef void(*)(void *callback_handle, vx_udp_frame_type frame_type, void *payload_data, int payload_data_len, void **header_out, int *header_len_out, void **trailer_out, int *trailer_len_out)pf_on_before_udp_frame_transmitted_t
Called before any UDP frame is transmitted.
typedef void(*)(void *callback_handle, vx_udp_frame_type frame_type, void *payload_data, int payload_data_len, void *header, int header_len, void *trailer, int trailer_len, int sent_bytes)pf_on_after_udp_frame_transmitted_t
Called after any UDP frame is transmitted.
typedef void(*)(void *callback_handle, const char *thread_name)pf_on_thread_created_t
Called after a thread is created.
typedef void(*)(void *callback_handle)pf_on_thread_exit_t
Called before a thread is destructed.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri)pf_on_audio_unit_started_t
Called when an audio processing unit is started in the audio processing thread.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri)pf_on_audio_unit_stopped_t
Called when an audio processing unit is stopped in the audio processing thread.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame)pf_on_audio_unit_after_capture_audio_read_t
Called after audio is read from the capture device.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_speaking)pf_on_audio_unit_before_capture_audio_sent_t
Called when an audio processing unit is about to send captured audio to the network from the audio processing thread.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *session_uri, vx_before_recv_audio_mixed_participant_data_t *participants_data, size_t num_participants)pf_on_audio_unit_before_recv_audio_mixed_t
Called before an audio processing unit mixes the per-participant audio data to a single stream in the audio processing thread.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_silence)pf_on_audio_unit_before_recv_audio_rendered_t
Called when an audio processing unit is about to write received audio to the render device in the audio processing thread.
typedef void(*)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame)pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis_t
Called before an audio processing unit informs its acoustic echo canceller about what audio is being output by the device.
typedef void(*)(int)pf_on_audio_unit_capture_device_status_changed_t
Called when the capture device status changes.
typedef void(*)(int fatal)pf_on_assert_t
Called when an unexpected situation is encountered in the SDK.
typedef struct vx_sdk_configvx_sdk_config_t
Configuration options that are passed to vx_initialize3().

Types Documentation

enum vx_log_level

Enumerator

Value

Description

log_none-1
log_error0Errors only.
log_warning1Warnings only.
log_info2Generic information.
log_debug3Detailed debugging information. Likely to have performance implications.
log_trace4The most verbose logging level. Likely to have performance implications.
log_all5Log almost everything. Very likely to have performance implications.
SDK logging levels.

enum vx_backend_type

Enumerator

Value

Description

backend_type_unknown-1
backend_type_sip0
backend_type_xmpp1
Values for the backend type.

enum vx_udp_frame_type

Enumerator

Value

Description

vx_frame_type_rtp0
vx_frame_type_rtcp1
vx_frame_type_sip_message2
vx_frame_type_sip_keepalive3
Values for the UDP packet type.

enum vx_bluetooth_profile

Enumerator

Value

Description

vx_bluetooth_profile_a2dp0
vx_bluetooth_profile_hfp1

typedef pf_on_before_udp_frame_transmitted_t

typedef void(* pf_on_before_udp_frame_transmitted_t) (void *callback_handle, vx_udp_frame_type frame_type, void *payload_data, int payload_data_len, void **header_out, int *header_len_out, void **trailer_out, int *trailer_len_out);
Called before any UDP frame is transmitted. This callback must be a non-blocking callback. It is recommended that this callback complete in less than 1 millisecond.

typedef pf_on_after_udp_frame_transmitted_t

typedef void(* pf_on_after_udp_frame_transmitted_t) (void *callback_handle, vx_udp_frame_type frame_type, void *payload_data, int payload_data_len, void *header, int header_len, void *trailer, int trailer_len, int sent_bytes);
Called after any UDP frame is transmitted. The application can use this callback to deallocate the header and trailer, if necessary.

typedef pf_on_thread_created_t

typedef void(* pf_on_thread_created_t) (void *callback_handle, const char *thread_name);
Called after a thread is created. The application can use this callback to monitor and profile thread creation.

typedef pf_on_thread_exit_t

typedef void(* pf_on_thread_exit_t) (void *callback_handle);
Called before a thread is destructed. The application can use this callback to monitor and profile thread destruction.

typedef pf_on_audio_unit_started_t

typedef void(* pf_on_audio_unit_started_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri);
Called when an audio processing unit is started in the audio processing thread. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_stopped_t

typedef void(* pf_on_audio_unit_stopped_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri);
Called when an audio processing unit is stopped in the audio processing thread. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_after_capture_audio_read_t

typedef void(* pf_on_audio_unit_after_capture_audio_read_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame);
Called after audio is read from the capture device. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_before_capture_audio_sent_t

typedef void(* pf_on_audio_unit_before_capture_audio_sent_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_speaking);
Called when an audio processing unit is about to send captured audio to the network from the audio processing thread. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_before_recv_audio_mixed_t

typedef void(* pf_on_audio_unit_before_recv_audio_mixed_t) (void *callback_handle, const char *session_group_handle, const char *session_uri, vx_before_recv_audio_mixed_participant_data_t *participants_data, size_t num_participants);
Called before an audio processing unit mixes the per-participant audio data to a single stream in the audio processing thread. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_before_recv_audio_rendered_t

typedef void(* pf_on_audio_unit_before_recv_audio_rendered_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_silence);
Called when an audio processing unit is about to write received audio to the render device in the audio processing thread. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis_t

typedef void(* pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis_t) (void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame);
Called before an audio processing unit informs its acoustic echo canceller about what audio is being output by the device. Mix application audio into pcm_frames so acoustic echo cancellation can attempt to remove it from the microphone capture signal. If the application is rendering Vivox voices instead of the Vivox SDK and the application is modifying the voice signals, ... then write the application audio mixed with the modified voice signals into pcm_frames, overwriting its previous contents. No blocking operations should occur on this callback.

typedef pf_on_audio_unit_capture_device_status_changed_t

typedef void(* pf_on_audio_unit_capture_device_status_changed_t) (int);
Called when the capture device status changes. No blocking operations should occur on this callback.

typedef pf_on_assert_t

typedef void(* pf_on_assert_t) (int fatal);
Called when an unexpected situation is encountered in the SDK.

typedef vx_sdk_config_t

typedef struct vx_sdk_config vx_sdk_config_t;
Configuration options that are passed to vx_initialize3().

Source code

/* Copyright (c) 2019 Unity Technologies. * * This software is subject to, and made available under, the Unity Terms of Service (see Unity Terms of Service). * Your use of this software constitutes your acceptance of such terms. * Unless expressly provided otherwise, the software under this license is made available strictly on an "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. * Please review the Terms of Service for details on these and other terms and conditions.” */#pragma once#include <time.h>#pragma pack(push)#pragma pack(8)#ifdef __cplusplusextern "C" {#endiftypedef enum { log_none = -1, log_error = 0, log_warning = 1, log_info = 2, log_debug = 3, log_trace = 4, log_all = 5} vx_log_level;typedef enum { backend_type_unknown = -1, backend_type_sip = 0, backend_type_xmpp = 1} vx_backend_type;typedef enum { vx_frame_type_rtp = 0, vx_frame_type_rtcp = 1, vx_frame_type_sip_message = 2, vx_frame_type_sip_keepalive = 3} vx_udp_frame_type;typedef struct { const char *participant_uri; short *pcm_frames; int pcm_frame_count; int audio_frame_rate; int channels_per_frame; const char *session_uri;} vx_before_recv_audio_mixed_participant_data_t;typedef void (*pf_on_before_udp_frame_transmitted_t)( void *callback_handle, // The handle passed in the vx_sdk_config_t structure vx_udp_frame_type frame_type, // The UDP packet type void *payload_data, // The data to be transmitted to the network int payload_data_len, // The len of the data to be transmitted to the network void **header_out, // Callback set - a pointer to header data (NULL if no header) int *header_len_out, // Callback set - the length of the header data (0 if no header) void **trailer_out, // Callback set - a pointer to trailer data (NULL if no trailer) int *trailer_len_out // Callback set - the length of the trailer data (0 if no trailer) );typedef void (*pf_on_after_udp_frame_transmitted_t)( void *callback_handle, // The handle passed in the vx_sdk_config_t structure vx_udp_frame_type frame_type, // The UDP packet type void *payload_data, // The data to be transmitted to the network int payload_data_len, // The len of the data to be transmitted to the network void *header, // The header data passed in pf_on_before_udp_frame_transmitted int header_len, // The length of the header data void *trailer, // The trailer data passed in pf_on_before_udp_frame_transmitted int trailer_len, // The length of the trailer data int sent_bytes // The total number of bytes transmitted - < 0 indicates an error );typedef void (*pf_on_thread_created_t)(void *callback_handle, const char *thread_name);typedef void (*pf_on_thread_exit_t)(void *callback_handle);typedef void (*pf_on_audio_unit_started_t)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri);typedef void (*pf_on_audio_unit_stopped_t)(void *callback_handle, const char *session_group_handle, const char *initial_target_uri);typedef void (*pf_on_audio_unit_after_capture_audio_read_t)( void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame );typedef void (*pf_on_audio_unit_before_capture_audio_sent_t)( void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_speaking );typedef void (*pf_on_audio_unit_before_recv_audio_mixed_t)( void *callback_handle, const char *session_group_handle, const char *session_uri, vx_before_recv_audio_mixed_participant_data_t *participants_data, size_t num_participants);typedef void (*pf_on_audio_unit_before_recv_audio_rendered_t)( void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame, int is_silence );typedef void (*pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis_t)( void *callback_handle, const char *session_group_handle, const char *initial_target_uri, short *pcm_frames, int pcm_frame_count, int audio_frame_rate, int channels_per_frame );typedef enum { vx_bluetooth_profile_a2dp = 0, vx_bluetooth_profile_hfp = 1} vx_bluetooth_profile;typedef void (*pf_on_audio_unit_capture_device_status_changed_t)(int);typedef void (*pf_on_assert_t)(int fatal);typedef struct vx_sdk_config { int num_codec_threads; int num_voice_threads; int num_web_threads; int render_source_queue_depth_max; int render_source_initial_buffer_count; int upstream_jitter_frame_count; int allow_shared_capture_devices; int max_logins_per_user; char app_id[3]; char cert_data_dir[256]; void * (*pf_malloc_func)(size_t bytes); void (*pf_free_func)(void *memory); void * (*pf_realloc_func)(void *memory, size_t bytes); void * (*pf_calloc_func)(size_t num, size_t bytes); void *(*pf_malloc_aligned_func)(size_t alignment, size_t size); void (*pf_free_aligned_func)(void *memory); int reserved; void *job_queue_handle; int (*pf_queue_job_sync)(void *job_queue_handle, void *job, size_t size); int (*pf_queue_job_async)(void *job_queue_handle, void *job, size_t size); long long processor_affinity_mask; void *callback_handle; void (*pf_logging_callback)(void *callback_handle, vx_log_level level, const char *source, const char *message); void (*pf_sdk_message_callback)(void *callback_handle); vx_log_level initial_log_level; int disable_device_polling; int force_capture_silence; int enable_advanced_auto_levels; pf_on_audio_unit_started_t pf_on_audio_unit_started; pf_on_audio_unit_stopped_t pf_on_audio_unit_stopped; pf_on_audio_unit_after_capture_audio_read_t pf_on_audio_unit_after_capture_audio_read; pf_on_audio_unit_before_capture_audio_sent_t pf_on_audio_unit_before_capture_audio_sent; pf_on_audio_unit_before_recv_audio_mixed_t pf_on_audio_unit_before_recv_audio_mixed; pf_on_audio_unit_before_recv_audio_rendered_t pf_on_audio_unit_before_recv_audio_rendered; int capture_device_buffer_size_intervals; int render_device_buffer_size_intervals; int disable_audio_ducking; int use_access_tokens; int enable_multiparty_text; int enable_dtx; unsigned int default_codecs_mask; pf_on_before_udp_frame_transmitted_t pf_on_before_udp_frame_transmitted; pf_on_after_udp_frame_transmitted_t pf_on_after_udp_frame_transmitted; int enable_fast_network_change_detection; int use_os_proxy_settings; int enable_persistent_http; int preferred_sip_port; int default_render_to_receiver; float mic_makeup_gain; pf_on_thread_created_t pf_on_thread_created; pf_on_thread_exit_t pf_on_thread_exit; int (*pf_request_permission_for_network)(void); int dynamic_voice_processing_switching; int ios_voice_processing_io_mode; pf_on_audio_unit_capture_device_status_changed_t pf_on_audio_unit_capture_device_status_changed; int never_rtp_timeout_ms; int lost_rtp_timeout_ms; vx_bluetooth_profile bluetooth_profile; int mobile_recording_conflicts_avoidance; pf_on_assert_t pf_on_assert; pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis_t pf_on_audio_unit_requesting_final_mix_for_echo_canceller_analysis;} vx_sdk_config_t;#ifdef __cplusplus}#endif#pragma pack(pop)