Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.15.2 - 2026-03-18

### New features

- Added `ProcessorAsync`, an async wrapper around `Processor` for use in `async`/`await` contexts (requires the `async` feature flag). It offloads blocking audio processing to a thread pool via `tokio::task::spawn_blocking`, keeping the async runtime responsive. All methods mirror the synchronous `Processor` API. A `ProcessorAsync::with_config` convenience constructor is also provided.

## 0.15.1 - 2026-03-17

## Improvements
Expand Down
99 changes: 97 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2024"
homepage = "https://ai-coustics.com/sdk/"
license = "Apache-2.0"
repository = "https://github.com/ai-coustics/aic-sdk-rs"
version = "0.15.1"
version = "0.15.2"

[workspace.dependencies]
aic-sdk-sys = { version = "0.15.1", path = "aic-sdk-sys" }
Expand Down Expand Up @@ -36,22 +36,32 @@ serde = { workspace = true, optional = true, features = ["derive"] }
serde_json = { workspace = true, optional = true }
sha2 = { workspace = true, optional = true }
thiserror = { workspace = true }
tokio = { version = "1.49", optional = true, features = ["rt", "sync"] }
ureq = { workspace = true, optional = true, features = ["rustls"] }

[dev-dependencies]
approx = "0.5"
futures = "0.3"
hound = "3.5"
serde_json = { workspace = true }
tokio = { version = "1.49", features = ["macros", "rt-multi-thread", "sync", "time"] }

[features]
async = ["dep:tokio"]
download-lib = ["aic-sdk-sys/download-lib"]
download-model = ["dep:serde", "dep:serde_json", "dep:sha2", "dep:ureq"]

[[example]]
name = "basic_usage"
path = "examples/basic_usage.rs"
required-features = ["download-model"]

[[example]]
name = "benchmark"
path = "examples/benchmark.rs"
required-features = ["async", "download-model"]

[[example]]
name = "parallel_async"
path = "examples/parallel_async.rs"
required-features = ["async", "download-model"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,13 @@ See the example files for complete working examples:
- [`examples/basic_usage.rs`](examples/basic_usage.rs) - Basic usage example
- [`examples/build-time-download`](examples/build-time-download) - Download and embed models at compile-time
- [`examples/benchmark.rs`](examples/benchmark.rs) - Run multiple processor instances concurrently until the real-time requirements are not met
- [`examples/parallel_async.rs`](examples/parallel_async.rs) - Demonstrates parallel processing with `ProcessorAsync`: runs N processors concurrently via `tokio::join_all` and prints each processor's individual time alongside a sequential baseline to confirm the speedup

Run examples with:
```bash
export AIC_SDK_LICENSE="your_license_key_here"
cargo run --example basic_usage --features download-lib,download-model
cargo run --example parallel_async --features download-lib,download-model,async
```

## Documentation
Expand Down
9 changes: 0 additions & 9 deletions examples/basic_usage.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#![cfg_attr(not(feature = "download-model"), allow(dead_code, unused_imports))]

#[cfg(feature = "download-model")]
use aic_sdk::{Model, Processor, ProcessorConfig, ProcessorParameter, VadParameter};
use std::env;

#[cfg(not(feature = "download-model"))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
Err("Enable the `download-model` feature to run this example.".into())
}

#[cfg(feature = "download-model")]
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Display library version
println!("ai-coustics SDK version: {}", aic_sdk::get_sdk_version());
Expand Down
Loading
Loading