Skip to content
Projetos

Sobre

Type any wake word and detect it! Wake word engine in 8 languages. Try it in your browser!

IA e aprendizado de máquina

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
+5
em 15 dias
+6
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

Hark

A zero-shot wake word engine for your own Jarvis: type a phrase, done. No recordings, no training.

I originally built Hark for my own voice assistant, PAI. Its old wake-word engine (sherpa-onnx) is solid in English but basically deaf to "Okay PAI" in German, and every alternative wanted me to either record myself 50 times or burn two hours of Colab per word. Somehow that "quick weekend fix" turned into 230+ training runs, so I figured I might as well open-source it.

You can try it right now in your browser (nothing leaves your device): Live Demo

Alpha Preview (v0.4.0-alpha). Supports 8 languages (German, English, Swedish, French, Spanish, Italian, Dutch, Polish) and runs on Linux x86_64 and ARM64 (Raspberry Pi 4/5, N100, mini PCs).

What's new in v0.4

  • 8 languages instead of 2 (DE, EN, SV, FR, ES, IT, NL, PL), and you don't need language tags anymore. Just type your phrase.
  • No more eSpeak or phoneme tables: both stages read plain text directly, so umlauts, accents, brand names and made-up words just work.
  • Big jump in accuracy: 87.7% on the 24h Picovoice benchmark (up from 78.1% in v0.3), 84.2% at zero false alarms in German, and a new filter that stops TikTok/Reels on phone speakers from setting it off.
  • 16x smaller Stage 1 (~540 KB): small enough to run right on an ESP32-S3 (Voice PE / ReSpeaker Lite) or in the browser demo, paired with a new Whisper-base Stage 2 verifier.

Getting started

Pick your setup:

What you have How to run Hark
Just want to test it Live Demo (runs locally in your browser)
Home Assistant OS Install the Home Assistant app (easiest)
Voice PE / ReSpeaker Lite ESP32 satellite guide (web flasher, streams mic to Home Assistant)
Docker / HA Container / Linux Run the Docker container
Python / Raspberry Pi / Custom Install via pip

Hark only handles the wake word. For a full Home Assistant voice setup you still need STT and TTS (e.g. Whisper + Piper). If you get stuck anywhere, check the FAQ.

Home Assistant OS

  1. Settings > Apps > Install app > three-dot menu > Repositories > add https://github.com/pioborgelt/hark.
  2. Search for Hark Wake Word, install it, add your phrases on the Configuration tab (e.g. "Hallo Kühlschrank", "Hey Jarvis", "Hej Hem"), save and start.
  3. Settings > Devices & services > click Add on the discovered Hark Wake Word.
  4. Settings > Voice assistants > your assistant > three-dot menu > Add streaming wake word > pick hark and your phrase.

Runs happily next to openWakeWord. If menu names differ or something is unclear, please open an issue.

Docker

mkdir -p hark-data
docker run -d --name wyoming-hark --restart unless-stopped \
  -p 10400:10400 \
  -v "$PWD/hark-data:/data" \
  -e HARK_PHRASES="Hallo Kühlschrank;Hey Jarvis" \
  -e HARK_SENSITIVITY="balanced" \
  ghcr.io/pioborgelt/hark:alpha

Downloads ~108 MB of weights into hark-data on first start (or use docker compose up -d). Add it in Home Assistant under Settings > Devices & services > Add integration > Wyoming Protocol (host IP, port 10400), then pick it in your assistant.

Python

pip install --index-url https://download.pytorch.org/whl/cpu "torch>=2.5,<3"
pip install "hark-ww[wyoming,microphone] @ git+https://github.com/pioborgelt/hark.git"

# try it live on your mic
hark listen -p "Okay Haus" -p "Hey Jarvis"

# or run the Wyoming server for Home Assistant
wyoming-hark --uri tcp://0.0.0.0:10400 --phrase "Okay Haus" --phrase "Hey Jarvis"

Or from your own code:

from hark.streaming import HarkEngine

engine = HarkEngine(threads=2)
stream = engine.create_stream([
    engine.enroll("Okay Haus"),
    engine.enroll("Hey Jarvis"),
])

for hit in stream.push(audio_float32_16khz):
    print("Triggered:", hit["phrase"])

A word on picking phrases: three or four syllables with clear consonants ("Hey Jarvis", "Hallo Computer", "Smart Mirror") work a lot better than tiny words like "Ey" or "Yo". Unless you enjoy talking to your toaster by accident.

Languages

Hark v0.4 was trained on 8 languages: German, English, Swedish, French, Spanish, Italian, Dutch and Polish.

You don't have to pick a language anywhere, just type your phrase (and you can mix languages at the same time). Umlauts, accents and made-up names work fine too. Other Latin-alphabet languages might even half-work by accident, though I haven't tested them, and non-Latin scripts aren't supported yet.

Show us the graphs!

Every Hark number here is zero-shot. I typed the phrase in and streamed 10 to 28 hours of speech, music and noise through it without ever resetting the state.

Home Assistant wake words (OpenVoiceOS benchmark)

The wild part: on OpenVoiceOS's streaming benchmark (400 triggers per word vs 10h continuous negatives), zero-shot Hark v0.4 beats Open Home Foundation's own microWakeWord v2 and their two-stage microWakeWord + Parakeet 110M stack on average (81.2% vs 73.6% at <= 0.1 FA/h), even though those models were specifically trained for each phrase and Hark only saw the text.

OpenVoiceOS Streaming Benchmark

Picovoice 24-hour benchmark (10 dB noise)

Six words, 24 hours of real noise at 10 dB SNR each, compared at <= 0.1 false alarms per hour (roughly two a day). Hark v0.4 hits 87.7% (+9.5 points over v0.3, +21.7 over sherpa-onnx). Porcupine is still ahead, but I think I'll get there ;)

24h Wake-Word Benchmark at 10 dB Noise

The test I actually built it for: "Okay PAI"

28 hours of real English speech, German podcasts and music as negatives, tested clean, in reverberant rooms and over loud music (fair warning: the positives here are synthetic voices, while the two benchmarks above use real people).

German Benchmark English Benchmark

All the tables, per-word numbers, and the 8-language Common Voice + Reels tests are in docs/BENCHMARKS.md.

How it works

Normal streaming wake word models only look backwards in time so they stay fast. The catch: in a noisy room, "he collects a..." sounds exactly like "Alexa" until you hear the syllable after it.

So Hark splits the job into two models (details in docs/ARCHITECTURE.md):

  1. Your phrase goes straight in as plain text, no eSpeak and no phoneme dictionaries. On startup, a small text encoder turns your phrase into a tiny ~2 KB fingerprint and automatically invents 8 look-alike decoys for it.
  2. The first model (~540 KB quantized) runs all the time in pure NumPy. It's tiny enough that it barely moves your CPU meter, while the second model stays asleep.
  3. When the first model thinks it heard your phrase, Hark waits another 0.3 seconds and wakes up the second model (built on Whisper-base) to look at the last 2 seconds of audio and compare your phrase against those 8 look-alikes. That kicks out almost all the near-misses.

Alpha heads-up and feedback

This is still an early alpha. v0.4 expanded from German and English to 8 languages (DE, EN, SV, FR, ES, IT, NL, PL) and ditched eSpeak completely, so I'm especially curious where it breaks on real microphones, weird room acoustics, and regional accents. Also, I'm an 18-year-old building this in my free time, mostly to learn along the way, so keep your expectations relaxed: this isn't Porcupine (for now...).

It runs on your Home Assistant server or Pi, like openWakeWord does (and if you have a Voice PE or ReSpeaker Lite, you can flash the streaming firmware in the ESP32 satellite guide). If a phrase feels deaf, or it goes off whenever your washing machine beeps, have a look at the logs (Hark logs every near miss its second stage rejects) and open an issue with your phrase, the language and your mic setup.

License

The code is MIT. The v0.4 alpha weights (on Hugging Face) are CC BY-NC 4.0, so they're free for personal use, Home Assistant setups, tinkering and research. They were trained on open speech and noise datasets (MLS, LibriSpeech, VoxPopuli, Common Voice, MUSAN) plus synthetic speech generated with Google Gemini TTS.

Explore projetos relacionados

Carregando…