aic-sdk = "=0.24.0". Core SDK: 0.24.0. Source: released crate. Signatures are declarations; import the named types from aic_sdk. See the Rust guide for a complete runnable program.
Processor
ProcessorContext can control state from another thread. Implements Drop, Send and Sync; it is not Clone. Native model storage is retained internally, while 'a keeps any borrowed model bytes alive. Dropping the model handle does not invalidate the processor, but its borrowed backing bytes must outlive it.
Processor::new
AicError. Call initialize or with_config before processing.
Processor::with_otel_config
LicenseFormatInvalid; a NUL-containing telemetry session ID returns Internal.
Processor::with_config
Processor::initialize
AudioConfigUnsupported. This allocates and must run outside the audio callback. If reinitialization fails, do not continue with assumed previous settings; successfully initialize again before processing.
Processor::process
block_size samples; variable mode accepts slices up to that size. Returns NotInitialized, AudioConfigMismatch or ProcessingNotAllowed when applicable.
The returned Result must be checked even when construction succeeded. The native processor may write delay-preserving fallback samples when processing is disallowed; other errors are not a universal unchanged-buffer guarantee. Handle errors according to your application’s continuity policy.
Processor::context
Result; an internal failure can panic.
Processor::terminate_session
ProcessorContext
Processor::context or await ProcessorAsync::context. There is no public constructor. Implements Drop, Send and Sync. Contexts share native control state and can be used while another thread processes audio. Dropping a context releases that handle; it does not destroy its processor. Keeping a context does not produce audio after its processor is gone.
ProcessorContext::set_parameter
ParameterOutOfRange.
ProcessorContext::parameter
ProcessorContext::audio_delay
1000.0 * delay as f64 / sample_rate as f64. The native query is asserted and can panic on internal failure.
ProcessorContext::reset
ProcessorContext::update_bearer_token
TokenUpdateUnsupported; an embedded NUL returns LicenseFormatInvalid. A rejected replacement is not installed. Successful local replacement does not prove backend acceptance; continue handling processing errors.
ProcessorParameter
Debug, Clone, Copy, PartialEq, Eq and Hash, plus conversion to the matching native parameter type. There is no Rust VoiceGain variant in this release.
ProcessorParameter::Bypass
ProcessorParameter::EnhancementLevel
parameter for the active value.
ProcessorAsync
async. Owns a synchronized processor backed by a shared worker pool. Constructors are synchronous. Methods marked async serialize access to this instance through a mutex and run expensive processing work on the pool. Await blocks in stream order and bound pending work; separate instances serve independent streams.
AIC_NUM_THREADS, read when the global pool is first created, selects a positive thread count; the default is available CPU parallelism. This type requires Model<'static>, from file loading or static embedded data. It implements Send and Sync through its fields, but not Clone; use Arc to share it. No cancellation or unbounded queue guarantee is implied.
ProcessorAsync::new
Processor::new.
ProcessorAsync::with_otel_config
ProcessorAsync::with_config
ProcessorAsync::initialize
AudioConfigUnsupported.
ProcessorAsync::process
Processor::process. On error the vector is dropped and is not returned, including when the native processor wrote fallback data.
ProcessorAsync::terminate_session
ProcessorAsync::context
get_context. Internal native context creation failure can panic.
See the model and configuration reference, errors and features and symbol index.
Process one block
This function receives an initialized processor and a normalized mono block from the caller. Errors propagate to the application:async feature, ownership of the vector passes to the operation: