Installation
Add the crate
Section titled “Add the crate”From your Rust project:
cargo add micro-wakewordThat enables the default listener feature, which includes microphone capture, channel conversion, and resampling.
For a low-level detector with no microphone dependencies:
cargo add micro-wakeword --no-default-featuresEquivalent Cargo.toml entries are:
[dependencies]micro-wakeword = "0.1"
# Or, when your application supplies 16 kHz mono PCM:# micro-wakeword = { version = "0.1", default-features = false }Platform setup
Section titled “Platform setup”Windows x86-64
Section titled “Windows x86-64”The TensorFlow Lite runtime is bundled and checksum-verified. Install the MSVC C++ build tools because the crate compiles its audio feature frontend from C++ source.
With Rust installed through rustup, the standard Windows MSVC toolchain is recommended:
rustup default stable-x86_64-pc-windows-msvcLinux x86-64 and ARM64
Section titled “Linux x86-64 and ARM64”Install your distribution’s audio development package for CPAL. On Ubuntu/Debian:
sudo apt-get install libasound2-devAlso install a C++ compiler if your distribution does not include one. The TensorFlow Lite runtime is bundled for glibc-based x86-64 and ARM64 systems. Musl and other architectures can use an explicit or system runtime; see TensorFlow Lite runtime.
macOS Intel and Apple Silicon
Section titled “macOS Intel and Apple Silicon”Install Xcode Command Line Tools with xcode-select --install. Microphone
capture uses CoreAudio, the matching TensorFlow Lite runtime is bundled, and
macOS asks for microphone permission when your app first records.
Keep model files together
Section titled “Keep model files together”A normal project layout looks like this:
my-app/├── Cargo.toml├── models/│ ├── wake-word.json│ └── wake-word.tflite└── src/ └── main.rsThe model path inside wake-word.json is resolved relative to the JSON file, not your executable.
Check the setup
Section titled “Check the setup”cargo checkcargo run --releaseUse release mode for real listening. Debug builds can process audio too slowly and cause avoidable dropped blocks.