Skip to content

Rikkarrr/KeywordListener

Repository files navigation

Keyword Listener

Simple voice keyword detection tool for Windows — listens through your mic and runs an alarm when specific words are detected. Uses Whisper (OpenAI) under the hood for transcription.

Built it for fun and personal use. Works surprisingly well, even offline.


What it does

  • Transcribes audio from your microphone using Whisper
  • Checks for phrases you define (comma, semicolon, or newline-separated)
  • Plays a sound if it hears something that matches
  • You can set volume, confidence, mic, speed/accuracy, etc.
  • Can run in background or minimized

Requirements

  • .NET 8 SDK
  • Windows 10 or later
  • Whisper CLI in Tools/whisper (already included, just not all models)

How to run it

Dev mode (via CLI)

dotnet build
dotnet run --project KeywordListener

Visual Studio

  • Open the .sln file
  • F5 (done)

Build a release version

dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true

This creates a self-contained .exe with everything baked in. You’ll find it under:

bin/Release/net8.0-windows/win-x64/publish/

Logging

Logs go to:

%AppData%\KeywordListener\Logs\

Everything gets dumped into app.log — phrases heard, matches, errors, etc. It’s just a plain text file.


📂 Folder overview

KeywordListener/
├── UI/              # WPF interface stuff
├── Services/        # logic, audio, logging, settings
├── Models/          # simple data classes
├── Tools/whisper/   # Whisper CLI goes here (models NOT included)
└── App.xaml.cs etc.

Whisper License Note

This uses Whisper by OpenAI, which is MIT licensed. That means you can use it freely, but you should include their license if you distribute it with your own app (check their repo for that).


Why?

I dont know.. xd


Future ideas (maybe)

  • Custom actions/scripts instead of just alarm sound
  • Auto-launch on Windows start
  • System tray integration
  • Whisper model auto-downloader

🛠 Troubleshooting

A few things that can go wrong and how to check them.

1. The app runs, but it doesn’t react to my voice

  • Make sure the correct microphone is selected in the app.
    • On different PCs, device index 0 can be a completely different input (e.g. “Stereo Mix” instead of your headset).
    • Try cycling through the mic dropdown and speaking while watching the status bar.
  • Check that your mic level is not super low or muted in Windows:
    • Windows Settings → System → Sound → Input.

If the app is “running” but nothing ever shows up in the Status or Heard text, it’s almost always a mic / input device issue.


2. Windows is blocking the microphone

On Windows 10/11, microphone access can be disabled globally:

  • Go to
    Settings → Privacy & security → Microphone
  • Make sure:
    • “Microphone access” is enabled
    • “Allow desktop apps to access your microphone” is ON

If this is off, the app can’t get any audio at all.


3. It hears something, but never triggers the alarm

A few things to check:

  • Phrases field is empty
    If there are no phrases, there is nothing to match. Add at least one keyword (e.g. test) and try again.

  • Confidence is too high
    If Min confidence is set to something like 0.9, Whisper may never reach that for normal speech.
    Try a lower value first (e.g. 0.5–0.7).

  • Wrong language / wording
    If you speak German but your phrases are in English (or vice versa), matching may fail depending on how Whisper transcribes it.

You can also watch the Heard text:
If you do see recognized text, but no alarm, the problem is almost always phrases / confidence, not audio.


4. No transcription at all (no “heard” text)

If the status shows it’s listening, but you never see any final text:

  • Make sure the app was fully extracted from the .zip before running.
    Running directly from inside the ZIP can break relative paths.
  • Check that the Whisper tools and model exist next to the app:
    • Tools/whisper/whisper-cli.exe
    • Tools/whisper/models/ggml-base.en.bin

If those are missing or moved, the app can’t call Whisper and will silently skip transcription.


5. Where to find logs

If something still feels off, check the log file. It usually contains hints like:

  • errors starting Whisper,
  • missing files,
  • or problems with audio.

Logs are written to:

%AppData%\KeywordListener\Logs\app.log

About

Just a little desktop application that listens to keywords when you're speaking and alarms you whenever a keyword has been detected.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages