aic-sdk = "=0.25.0". Core SDK: 0.25.0. Source: released crate. Signatures are declarations; import the named types from aic_sdk. See the Rust guide for a complete runnable program.
Vad
Drop, Send and Sync; borrowed model bytes must outlive the detector. Mutable access serializes processing and initialization.
Vad::new
ModelTypeUnsupported. Credentials are an SDK key or JWT.
Vad::with_otel_config
Internal.
Vad::with_config
Vad::initialize
AudioConfigUnsupported. This allocates; run it outside the audio callback. Reinitialize successfully after any failed reconfiguration.
Vad::process
NotInitialized, AudioConfigMismatch and ProcessingNotAllowed. Read predictions after successful processing.
Vad::context
Vad::terminate_session
VadContext
Vad::context or awaited VadAsync::context. Implements Drop, Send and Sync; no public constructor. It permits cross-thread prediction reads and parameter control while the detector processes elsewhere. Predictions stop updating when audio is no longer processed.
VadContext::is_speech_detected
prediction_delay() samples; do not treat a stale decision as a new inference.
VadContext::raw_vad_probability
VadContext::set_parameter
ParameterOutOfRange. Effective transitions are quantized to model frames.
VadContext::parameter
VadContext::prediction_delay
VadContext::reset
VadContext::update_bearer_token
TokenUpdateUnsupported. Embedded NUL returns LicenseFormatInvalid. Local success does not prove backend acceptance; keep handling processing errors.
EnergyVadContext
Processor::energy_vad_context or awaited ProcessorAsync::energy_vad_context. Implements Drop; no public constructor. It detects speech from the processor’s enhanced signal before output mixing, without running a separate model, and advances with Processor::process rather than its own call.
All handles from one processor reference the same energy VAD, and every method maps to a native call usable from any thread, so a context can be moved to another thread while audio is processed elsewhere. Creating one keeps inference active even when the processor is bypassed or fully dry. Dropping the backing processor stops new predictions; dropping the context destroys neither the processor nor its detection.
EnergyVadContext::is_speech_detected
prediction_delay samples; align speech decisions to the input timeline using that value. The prediction stops updating if the backing processor stops being processed.
EnergyVadContext::set_parameter
VadParameter::Sensitivity takes the energy range, 1.0 through 15.0. Out-of-range values return ParameterOutOfRange. All parameters can be changed during processing, from any thread.
EnergyVadContext::parameter
EnergyVadContext::prediction_delay
ProcessorContext::audio_delay for the backing processor; energy detection adds no audio delay. Speech hold and minimum speech duration affect decision timing and are not included.
EnergyVadContext::reset
ProcessorContext::reset also resets this VAD.
VadParameter
VadContext and EnergyVadContext. Implements Debug, Clone, Copy, PartialEq, Eq and Hash, plus native parameter conversion. Read defaults from the active context.
VadParameter::SpeechHoldDuration
2 * duration history was above threshold.
VadParameter::Sensitivity
VadContext, a probability threshold, 0.0 through 1.0: a probability strictly greater than this value contributes a positive frame, so a lower threshold is more permissive. On an EnergyVadContext, the energy threshold of the enhanced signal, computed as 10 ^ (-sensitivity) over 1.0 through 15.0, so higher values detect quieter speech.
VadParameter::MinimumSpeechDuration
VadAsync
async. Uses the same shared worker pool and per-instance mutex as async enhancement. Constructors are synchronous, model data must be static, and async operations should be awaited in stream order. The type is Send and Sync; share through Arc when needed.
VadAsync::new
Vad::new.
VadAsync::with_otel_config
VadAsync::with_config
VadAsync::initialize
Vad::initialize.
VadAsync::process
None result; input length and errors match Vad::process.