Skip to main content
All functions on this page are from C SDK 0.24.0, core 0.24.0. Include aic.h and link the matching native library. Start with the C integration guide. The pointer and error contract applies to every signature below. Error names in prose omit the AIC_ERROR_CODE_ prefix. There are no default C arguments; optional pointers are stated explicitly. Use a compatible Tyto model. The collector accepts mono float32 samples; the analyzer reads a snapshot of the collected features. A successful buffering call is not a completed model inference. Read analysis fields only after a successful analysis call.

aic_analyzer_pair_create

collector and analyzer are distinct writable output slots. model must be an analysis model; license_key is a null-terminated SDK key or supported bearer token. On success, each output is independently owned and must be destroyed. The analyzer retains the model data. Creation allocates; it does not initialize the collector. Returns SUCCESS, NULL_POINTER, MODEL_TYPE_UNSUPPORTED, license errors or INTERNAL_ERROR. This API has no OTel configuration parameter and disables optional OTel export for this pair; SDK session requirements remain separate.

aic_collector_initialize

Configures collector with sample_rate in Hz (8,000–192,000), positive block_size in mono samples and fixed (false) or variable (true) block sizing. Fixed input must match the block size; variable input cannot exceed it. Returns SUCCESS, NULL_POINTER or AUDIO_CONFIG_UNSUPPORTED. Failure leaves the collector uninitialized. Allocate and initialize before starting audio collection; do not reinitialize while collecting.

aic_collector_buffer

Copies/accumulates audio_len mono float32 samples from the readable audio_ptr into the collection pipeline without modifying input. Returns SUCCESS, NULL_POINTER, NOT_INITIALIZED or AUDIO_CONFIG_MISMATCH. This collects features; it does not run analysis or return scores. One thread may feed the collector while a separate thread calls the paired analyzer; do not call this function concurrently on one collector.

aic_collector_destroy

Releases collector; NULL is a no-op. Stop calls using that handle first. The analyzer is owned separately and is not destroyed by this call. Teardown is outside the audio callback. No return value.

aic_analyzer_reset

Requests a reset of the paired collector through analyzer. The next collection call clears pending stream state; analysis while the reset is pending uses an empty, padded window. Returns SUCCESS or NULL_POINTER. Parameters and collector audio configuration are retained. Coordinate unrelated recordings so they do not share a window.

aic_analyzer_analyze_buffered

Runs the model on the latest fixed-size feature window from analyzer and writes all seven fields of writable result only on success. Early windows are silence-padded; repeated calls without new input can score the same window. This does not consume a caller-owned audio buffer. Returns SUCCESS, NULL_POINTER, PROCESSING_NOT_ALLOWED or INTERNAL_ERROR (for example, no usable snapshot). Call off the audio thread and serialize analysis calls. The paired collector can continue feeding from another thread.

aic_analyzer_terminate_session

Requests session termination through analyzer. Returns SUCCESS or NULL_POINTER; it does not destroy either handle. Termination is asynchronous and is a no-op if no session exists. Stop analysis explicitly and release both handles when finished. On native targets, terminating the final active session may wait for the shared telemetry tasks to finish. Call it outside the audio callback.

aic_analyzer_update_bearer_token

Updates the analyzer session with null-terminated UTF-8 token. Both original and new credentials must use supported JWT form. Returns SUCCESS, NULL_POINTER, LICENSE_FORMAT_INVALID, other license errors or TOKEN_UPDATE_UNSUPPORTED. Call on a control thread. Success means local credential replacement, not backend acknowledgment.

aic_analyzer_destroy

Releases analyzer, its model reference and its associated session. NULL is a no-op. The collector must be destroyed separately. Stop calls using the analyzer first; destruction can block. No return value. C API index · C examples · Compatibility

Example: check an analysis result

Run this helper on the analysis thread after initializing and feeding the paired collector. It copies the headline score only on success.