Rustpotter
A free and open source wake word spotter forged in rust.
Warning!
This project is under active development and testing, api and model format are broken usually, consider rustpotter and all the related projects in beta until version 1.0.0 is published.
But don't hesitate to report any issues in the meantime.
Description
This project allows to detect specific wake words on a live audio stream.
To do so it generates a set of features from some audio samples to later compare them with the features generated from the live stream, to calculate the probability of a match.
The features can be loaded from a previous generated model file or extracted from the samples before start the live streaming.
Web Demo
This web demo is available so you can quickly try out Rustpotter using a web browser
It includes some models generated using multiple voices from a text-to-speech service, you can also load your own ones.
Audio Format
This project uses wav, it works internally with the spec 48000hz 16 bit 1 channel int, but allows to configure the detector to work with other specs.
The detector configuration is ignored when adding a keyword with samples (add_wakeword method) as the wav spec is read from each file header (so raw samples are not allowed).
Related projects
- rustpotter-cli: Use rustpotter on the command line (the only that exposes model generation at the moment).
- rustpotter-java: Use rustpotter on java.
- rustpotter-wasm: Generator for javascript + wasm module.
- rustpotter-worklet: Ready to use package for web (runs rustpotter-web in a worklet).
- rustpotter-web: Npm package generated with rustpotter-wasm targeting web.
Versioning
All related packages use the version number of the rustpotter dependency (PATCH number could defer) so models generated with some version of the cli should work with other packages on the same version.
Some examples:
Create wakeword model:
let mut detector_builder = new;
let mut word_detector = detector_builder.build;
let name = Stringfrom;
let path = Stringfrom;
word_detector.add_wakeword;
match word_detector.create_wakeword_model ;
Spot wakeword:
let mut detector_builder = new;
detector_builder.set_threshold;
detector_builder.set_sample_rate;
let mut word_detector = detector_builder.build;
let result = word_detector.add_wakeword_from_model;
if result.is_err
while true
References
This project started as a port of the project node-personal-wakeword and uses the method described in this medium article.
Motivation
The motivation behind this project is to learn about audio analysis and Rust. Also to have access to an open source personal wakeword spotter to use in other open projects.
Feel free to suggest any improvements or fixes.