Skip to main content
C++ wrapper 0.24.0, core 0.24.0, C++11 or newer. Include aic.hpp and link the matching wrapper/native libraries. Start with the C++ integration guide. All names below are in namespace aic. Check Result and error handling before extracting a factory result. Ordinary C++ allocation or string operations can still throw; SDK status failures use the declared return values.

aic::Vad

Owns one native handle. Its destructor releases that handle; do not destroy or move the object while another thread uses it. Construction/destruction can allocate or block, so keep them outside the audio callback. The default constructor and raw-handle constructor are private: use the documented factory.

aic::Vad::create

Creates an owned Vad using a dedicated VAD model and the null-terminated representation of license_key (SDK key or supported bearer token). The object retains model data; no ownership of the Model wrapper is transferred. otel_config is optional and is copied during creation. Returns a checked result; errors include ModelTypeUnsupported, license errors and InternalError. Construction does not initialize audio configuration. Keep it outside the audio callback.

aic::Vad::initialize

Initializes or reinitializes the object. sample_rate is the host rate in Hz (8,000–192,000); block_size is a positive mono sample count. With variable_block_size=false, input must match exactly; with true, it is the maximum per call. All three arguments are required: there is no config-object overload. Returns Success or AudioConfigUnsupported (or NullPointer for an invalid underlying handle). Failure leaves the object uninitialized. Initialization resets state and allocates; serialize it with processing.

aic::Vad::process

Reads audio_len mono float32 samples from audio and copies them to an internal buffer. It does not modify the caller’s buffer. On success, read the updated decision through the context. Use normalized samples, nominally -1.0 to 1.0. Returns Success, NullPointer, NotInitialized, AudioConfigMismatch or ProcessingNotAllowed (and internal errors). Do not use a stale VAD decision after a failed call. Keep one instance per stream and serialize its processing calls.

aic::Vad::terminate_session

Requests asynchronous session termination and returns Success (or NullPointer for an invalid underlying handle). Processing may continue until the request is handled. It is a no-op for a credential with no telemetry session. The call neither destroys the object nor proves backend acknowledgment. Stop application processing explicitly, then allow normal destruction. On native targets, terminating the final active session may wait for the shared telemetry tasks to finish. Call it outside the audio callback.

aic::Vad::create_context

Creates a separately owned control object with shared state. Check the result before extracting it. The context can outlive its source object, but it cannot process audio after that object is destroyed. Errors include NullPointer and InternalError if a VAD context is unavailable. Context creation allocates.

aic::VadContext

Owns one native handle. Its destructor releases that handle; do not destroy or move the object while another thread uses it. Construction/destruction can allocate or block, so keep them outside the audio callback. The default constructor and raw-handle constructor are private: use the documented factory. Context control reads, parameter updates and reset requests use shared state and can run alongside processing. Keep handles alive through all concurrent calls. Credential updates are control-thread operations; destruction is never concurrent-safe.

aic::VadContext::reset

Requests processing-state reset for the next audio call and immediately clears the published decision and probability. Audio configuration and parameters remain in place. Returns Success or NullPointer. Coordinate the stream boundary if you require a precise reset position.

aic::VadContext::set_parameter

Sets a declared VadParameter to value. Returns Success, NullPointer or ParameterOutOfRange; NaN is out of range. The parameter table below defines units, defaults and accepted ranges.

aic::VadContext::get_parameter

Returns the stored value of a declared parameter. The wrapper asserts C success, rather than returning a Result. A C failure leaves the initialized fallback at zero if assertions are disabled. Do not use invalid enum values or a moved-from context. Duration parameters are in seconds; frame quantization affects the actual decisions.

aic::VadContext::get_prediction_delay

Returns the prediction delay in samples at the initialized host rate. Query after successful initialization and again after changing audio configuration. This is not elapsed CPU time. The wrapper asserts C success and has a zero fallback if assertions are disabled.

aic::VadContext::update_bearer_token

Replaces local credentials using token.c_str(). Both the original and replacement credentials must use supported JWT form. Returns Success, LicenseFormatInvalid, other license errors or TokenUpdateUnsupported (and NullPointer for an invalid handle). Success does not prove backend acceptance. Run on a control thread. See authentication.

aic::VadContext::is_speech_detected

Returns the latest filtered speech decision. Call Vad::process successfully to advance it. It combines probability threshold, minimum speech duration and hold behavior. The wrapper asserts C success and uses false as its assertion-disabled error fallback.

aic::VadContext::get_raw_vad_probability

Returns the latest speech probability before duration filtering. It does not process audio or replace the final speech decision. The wrapper asserts C success and uses zero as its assertion-disabled error fallback.

aic::VadParameter

Use only these enum class members, whose underlying type is int. C++ API index · Streams and state · Audio format

Example: read the decision after processing

Use a valid initialized VAD and its context. The decision getter relies on that valid context.