Metadata-Version: 2.4
Name: pymicro-wakeword
Version: 2.2.0
Summary: A TensorFlow based wake word detection training framework using synthetic sample generation suitable for certain microcontrollers.
Author-email: Michael Hansen <mike@rhasspy.org>
License: Apache-2.0
Project-URL: Source Code, https://github.com/OHF-Voice/pymicro-wakeword
Keywords: wakeword,detection,hotword
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymicro-features<3,>=2
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pylint; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: license-file

# Python microWakeWord

Python library for [microWakeWord](https://github.com/kahrendt/microWakeWord).

Uses a [pre-compiled Tensorflow Lite library](https://github.com/tphakala/tflite_c).


## Install

``` sh
pip3 install pymicro-wakeword
```


## Usage

``` python
from pymicro_wakeword import MicroWakeWord, MicroWakeWordFeatures, Model

mww = MicroWakeWord.from_builtin(Model.OKAY_NABU)
mww_features = MicroWakeWordFeatures()

# Audio must be 16-bit mono at 16Khz
while audio := get_10ms_of_audio():
    assert len(audio) == 160 * 2  # 160 samples
    for features in mww_features.process_streaming(audio):
        if mww.process_streaming(features):
            print("Detected!")
```


## Command-Line

### WAVE files

``` sh
python3 -m pymicro_wakeword --model 'okay_nabu' /path/to/*.wav
```

### Live

``` sh
arecord -r 16000 -c 1 -f S16_LE -t raw | \
  python3 -m pymicro_wakeword --model 'okay_nabu'
```
