aic-sdk = "=0.24.0". Core SDK: 0.24.0. Source: released crate. These APIs do not require the async feature. Import types from aic_sdk; signatures below are declarations.
analyzer_pair
AicError.
The pair shares native audio state. Retained model storage keeps weights available after dropping the model handle; borrowed model bytes must still outlive the analyzer. There are no public Collector::new or Analyzer::new constructors. This function accepts no OtelConfig. Its native creation path disables optional OpenTelemetry export; SDK authorization and session reporting requirements remain separate.
Collector
analyzer_pair. Implements Drop, Send and Sync; it is not Clone. Collection uses mutable access and can run on a separate thread from the paired analyzer. Dropping it releases its native handle.
Collector::initialize
ProcessorConfig::optimal(model) as a starting point. The configuration is copied; unsupported combinations return AudioConfigUnsupported. This allocates and must run outside the audio callback.
Collector::buffer
block_size with variable blocks enabled. Returns NotInitialized or AudioConfigMismatch when applicable. The call buffers audio; it does not return a score or perform the expensive analysis forward pass.
Analyzer
Drop, Send and Sync; it is not Clone. Mutable access serializes analysis and termination. The lifetime keeps borrowed model bytes alive; native handles retain model storage. Dropping the analyzer releases its handle and requests session shutdown.
Analyzer::reset
Analyzer::analyze_buffered
ProcessingNotAllowed with no result. Repeated calls without fresh audio are not fresh independent observations.
Analyzer::terminate_session
Analyzer::update_bearer_token
TokenUpdateUnsupported for unsupported credential types and LicenseFormatInvalid for embedded NUL characters. Local replacement does not prove backend acceptance; keep checking analysis errors.
FileAnalyzer
Model itself for 'model; keep that model handle alive, as well as any bytes borrowed for 'a. This is stricter than using analyzer_pair directly. Its owned fields release native resources on drop.
There is no public token-update, reset or session-termination method on this type. Use Analyzer directly when those lifecycle controls are required. Calls require mutable access and must be serialized.
FileAnalyzer::new
analyze call, allowing different input rates on subsequent calls. Credential and model errors match analyzer_pair.
FileAnalyzer::analyze
sample_rate, leaving the slice unchanged. The native collector handles supported non-native rates; this method does not mix channels. It initializes the collector at the model’s preferred block size and analyzes independent five-second windows.
step_samples is the advance between window starts. None uses 5 * sample_rate; smaller positive values overlap windows and larger values leave gaps. Rate zero or step zero returns AudioConfigUnsupported, as does an unsupported native configuration. Other initialization, buffering or analysis errors propagate as AicError without a partial result vector.
Empty input and buffers up to five seconds produce one silence-padded result. Longer buffers produce only complete windows on the step grid starting at zero; partial trailing windows are omitted. Each window resets the analysis/collection state. The operation allocates and performs blocking computation; run it outside the audio callback.
AnalysisResult
Debug, Clone and PartialEq, plus conversion from the native result struct. Values returned by the model lie between 0.0 and 1.0. They are not calibrated failure probabilities for your downstream system.