Skip to main content

Module examples

Module examples 

Source
Expand description

Example programs.

You can run any of the examples with the following steps.

Create a new empty directory. Change into it and run:

cargo init

Replace the contents of src/main.rs with the Rust code of the example you want to try. Note that some examples have additional/different instructions, but in most cases you should add the ai-coustics SDK with:

cargo add aic-sdk --features download-lib,download-model

The examples read the license key from the environment variable AIC_SDK_LICENSE, so you’ll have to set that up:

export AIC_SDK_LICENSE="your_license_key_here"

Finally, (compile and) run the example:

cargo run

Modules§

analyze_file
Analyze a WAV file given on the command line and print the resulting scores.
benchmark
Run processor instances concurrently until they stop keeping up with real time, to find how many streams a machine sustains.
build_time_download
Download a model while the program is compiled and embed it into the binary.
enhancement
Load a model, configure a processor and enhance a block of audio.
parallel_asyncasync
Process several streams concurrently with ProcessorAsync on an async runtime.
vad
Detect speech with a dedicated VAD model and read the prediction from a VAD context.