use aic_sdk::{include_model, ProcessorConfig, Model, Processor};// Embed model at compile time (or use Model::from_file to load at runtime)static MODEL: &'static [u8] = include_model!("/path/to/model.aicmodel");fn main() -> Result<(), Box<dyn std::error::Error>> { // Get your license key from the environment variable let license_key = std::env::var("AIC_SDK_LICENSE")?; // Load the embedded model (or download manually at https://artifacts.ai-coustics.io/) let model = Model::from_buffer(MODEL)?; // Get optimal configuration based on the selected model let config = ProcessorConfig::optimal(&model); // Create a processor and initialize it let mut processor = Processor::new(&model, &license_key)?.with_config(&config)?; // Process audio (one buffer of mono f32 samples, enhanced in place) let mut audio_buffer = vec![0.0f32; config.block_size]; processor.process(&mut audio_buffer)?; Ok(())}
The processor handles one mono stream. Downmix multi-channel audio before processing, or create one processor per channel. See Audio Format.
Was this page helpful?
⌘I
Assistant
Responses are generated using AI and may contain mistakes.