https://github.com/mideind/fluttersnowboy
Flutter plugin for Snowboy DNN-based hotword detection
https://github.com/mideind/fluttersnowboy
android dart flutter flutter-plugin hotword-detection hotword-detector ios snowboy wakeword-activation
Last synced: 5 months ago
JSON representation
Flutter plugin for Snowboy DNN-based hotword detection
- Host: GitHub
- URL: https://github.com/mideind/fluttersnowboy
- Owner: mideind
- License: other
- Created: 2021-04-27T18:12:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T13:20:07.000Z (over 2 years ago)
- Last Synced: 2025-08-28T22:50:58.708Z (10 months ago)
- Topics: android, dart, flutter, flutter-plugin, hotword-detection, hotword-detector, ios, snowboy, wakeword-activation
- Language: Java
- Homepage:
- Size: 4.02 MB
- Stars: 17
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://opensource.org/licenses/Apache-2.0)
[]()
[]()
[]()


[]()
# Flutter Snowboy plugin
This repository contains the source code to the Flutter Snowboy package.
[Snowboy](https://github.com/seasalt-ai/snowboy) is a cross-platform
DNN-based hotword detection toolkit implemented in C++. This package
makes it easy to use Snowboy in your Flutter app.
Currently only iOS and Android are supported.
## Models
The Flutter Snowboy package requires a working Snowboy detection
model (`pmdl`) to be useful. To train your own model, clone
[this repo](https://github.com/seasalt-ai/snowboy) and follow
the instructions.
## How to use
### Add dependency to project
Add this to the dependencies list in your `pubspec.yaml` file:
```yaml
flutter_snowboy: ">=0.1.2"
```
### Initialize detector
```dart
import 'package:flutter_snowboy/flutter_snowboy.dart';
...
// Instantiate
var detector = Snowboy();
// Load model and other resources.
// This is a moderately expensive operation since it involves file I/O.
var success = detector.prepare("/absolute/path/to/model.pmdl");
```
### Start
```dart
void hwHandler() {
print("Hotword detected");
}
detector.hotwordHandler = hwHandler;
// ... get audio data as UInt8List (e.g. via flutter_sound) and feed into
// the detect function. Audio data should be 16 kHz, 16-bit mono PCM.
detector.detect(data);
// ... and hwHandler() gets called when the hotword is detected in audio data.
```
## Contributing
All contributions are welcome. If you would like to lend and hand, feel free to
fork this repository and open pull requests.
## Version History
* 0.1.2 - Various fixes (20-05-2023)
* 0.1.1 - Null safety + minor fixes. Now requires Dart 2.12+ (12-01-2022)
* 0.1.0 - Initial release (24-08-2021)
## License
flutter_snowboy is Copyright (C) 2021-2023 [Miðeind ehf.](https://mideind.is)
Snowboy is Copyright (C) 2016-2020 KITT.AI
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
or [here](LICENSE)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.