openwakeword/examples
2023-01-29 22:31:45 +01:00
..
audio beep on activation WIP 2023-01-29 22:31:45 +01:00
utils beep on activation WIP 2023-01-29 22:31:45 +01:00
benchmark_efficiency.py Final preparation for initial release 2022-12-23 14:51:49 -05:00
capture_activations.py beep on activation WIP 2023-01-29 22:31:45 +01:00
detect_from_microphone.py Adjusted some example scripts to fix bugs and removed 'plotext' usage as it wasn't functioning right on low-power hardware 2023-01-28 13:58:57 -05:00
mine_false_positives.py Added some scripts and functions to assist with collection false activations 2023-01-22 20:06:37 -05:00
README.md Adjusted some example scripts to fix bugs and removed 'plotext' usage as it wasn't functioning right on low-power hardware 2023-01-28 13:58:57 -05:00

Examples

Included are several example scripts demonstrating the usage of openWakeWord. Some of these examples have specific requirements, which are detailed below.

Detect From Microphone

This is a simple example which allows you to test openWakeWord by using a locally connected microphone. To run the script, follow these steps:

  1. Install the example-specific requirements: pip install pyaudio

  2. Run the script: python detect_from_microphone.py.

Note that if you have more than one microphone connected to your system, you may need to adjust the PyAudio configuration in the script to select the appropriate input device.

Capture Activations

This script is designed to run silently in the background and capture activations for the inlcluded pre-trained models. You can specify the initialization arguments, activation threshold, and output directory for the saved audio files for each activation. To run the script, follow these steps:

  1. Install the example-specific requirements:
# On Linux
pip install pyaudio scipy

# On Windows
pip install PyAudioWPatch scipy
  1. Run the script: python capture_activations.py --threshold 0.5 --output_dir <my_dir>

Note that if you have more than one microphone connected to your system, you may need to adjust the PyAudio configuration in the script to select the appropriate input device.

Benchmark Efficiency

This is a script that estimates how many openWakeWord models could be run on on the specified number of cores for the current system. Can be useful to determine if a given system has the resources required for a particular use-case.

To run the script: python benchmark_efficiency.py --ncores <desired integer number of cores>