Skip to main content

Tools for building wake-word and speech-command datasets and models.

Project description

wakewords (python)

Build custom wakewords detection datasets and models from synthetic data (TTS-generated).

This python library is for training wakewords models. For using the models trained using this tool, please check the wakewords javascript and swift libraries.

Install

# For pip
pip install wakewords

# For uv
uv add wakewords

How to train a wakewords model for your custom words

1. Create a project

cd into any directory and run the init command to create the project scaffolding and a config.json.

uv run wakewords init

2. Define your wake words

Edit config.json and put your wake words in custom_words. Define as many as you like.

  • tts_input is what is sent to the TTS to generate the audio.
  • label is for the dataset.
{
  "custom": [
    {"tts_input": "Atlas", label: "atlas}
  ]
}

The default config includes words from the google speech commands dataset by default. Feel free to review them and retain what you like.

3. Set Up TTS provider credentials

The default TTS provider is Cartesia. Set your API key to generate audio:

export CARTESIA_API_KEY=your-api-key

Custom TTS providers can be registered from config.json. See ../docs/custom-providers.md.

3. Generate audio samples

Generate clean samples for the custom_words in the project config.json using every available voice:

uv run wakewords generate --lang en --all-voices

The lang option is for a specfic language. If you skip it, it'll use the voices you specify. Check docs for more options like selecting by gender, language, etc. You can specify config to stay selective like "3 voices per gender per language".

Generated audio and metadata are written to the project's data/custom_words.parquet.

4. Augment the dataset

This command will augment the dataset to create more samples using variations with background noise, tempo and snr. The target sample size post-augmentation is around 4k samples per word.

uv run wakewords augment

The default target for total number of samples per word is 4000 (approximated). This is to match the number of samples for each word in the google speech commands dataset (helps if you retain the words for that dataset too). Helps balance the samples available for each word.

So the command calculates (targetSamplesPerWord = 4000 - generatedSamples) and then generates enough variations to (approximately) match that target sample count.

5. Train your model

Download Google Speech Commands, build manifests, and preview the training run:

# Download google speech commands dataset
uv run wakewords download

# Create manifest files for 70-20-10 split (train-validate-test)
uv run wakewords manifest

# Start training (linux only).
# Default 15 epochs. Use --max-epochs to change.
uv run wakewords train

Export

Export the latest completed training run into a project-level model bundle:

# defaults to onnx format
uv run wakewords export
  • This writes models/model.onnx and models/labels.json for inference.
  • And also saves models/last_checkpoint/last.ckpt.

You can now use model.onnx and labels.json for inference with the wakewords javascript or swift libraries.

More Details

We have other commands like checkdata. See ../docs/python.md for command options, split ratios, augmentation details, cleaning commands, and training notes.

License

Copyright © 2026 Akash Manohar John, under MIT License (See LICENSE file at root of git repo).

Background sounds: The background audio embedded in this PyPI package comes from the Google Speech Commands dataset and ships with this library for convenience. This is licensed under the same license as the dataset. The details are in the README.md file inside of the wakewords/google_scd_background_noise dir.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wakewords-0.3.23.tar.gz (568.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wakewords-0.3.23-py3-none-any.whl (428.1 kB view details)

Uploaded Python 3

File details

Details for the file wakewords-0.3.23.tar.gz.

File metadata

  • Download URL: wakewords-0.3.23.tar.gz
  • Upload date:
  • Size: 568.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wakewords-0.3.23.tar.gz
Algorithm Hash digest
SHA256 7b0489eb1b4e4d7aff92b317c2e4503a4688e54d78da5b167950172b8cc7a73e
MD5 4ffa2ed400d8207e51639c3fd9c3b50b
BLAKE2b-256 b391f8918604e6c0f72104aed3d9142e738e5cf37e2a58658b99aaf56aa8fc89

See more details on using hashes here.

Provenance

The following attestation bundles were made for wakewords-0.3.23.tar.gz:

Publisher: publish.yml on HashNuke/wakewords

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wakewords-0.3.23-py3-none-any.whl.

File metadata

  • Download URL: wakewords-0.3.23-py3-none-any.whl
  • Upload date:
  • Size: 428.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wakewords-0.3.23-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b9b8cce71f50b933eff4cb60de98496e75878ee6a2978e6cb443da620563d2
MD5 3a819f4838556e410b459c79a031e4d5
BLAKE2b-256 09b315b8cb2bcbaa09ada74dd869ef7fc35b9d2fed7ccaa5ecd2fd59d685ad3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wakewords-0.3.23-py3-none-any.whl:

Publisher: publish.yml on HashNuke/wakewords

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page