Skip to content

About

Snap your fingers twice to launch Dota 2 (or any program). Windows tray app with adaptive snap detection, calibration, autostart and EN/RU UI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

SnapLauncher

Snap your fingers twice — your game starts.

SnapLauncher listens to the microphone, recognises a double finger snap (or a double clap) and launches Dota 2 — or any other Steam game, program, script or link. It lives in the system tray, starts with Windows and has a settings window where everything is adjustable: microphone, sensitivity, what to launch, how many snaps, language.

Build Release License: MIT Windows

Русская версия / Russian README

SnapLauncher settings window

Features

  • Double snap → action. Finger snaps, hand claps or any sharp sound; 1–4 sounds in a row, adjustable gap.
  • Real detector, not a volume trigger. Every 10 ms block is checked for peak, signal-to-noise ratio, attack sharpness and high-frequency share; sounds longer than 120 ms (voice, music) are rejected; the noise floor adapts to the room.
  • Auto microphone. Skips virtual devices (Steam Streaming, Oculus, VB-Cable…), probes real ones for signal, reconnects if the mic disappears.
  • Says why it hears nothing. A microphone muted in Windows delivers perfect silence and looks identical to a broken one — SnapLauncher tells them apart, shows an orange Microphone is muted status and unmutes it in one click; if the device is simply gone it keeps looking for another one.
  • One-click calibration. Snap 3–5 times, the app picks the sensitivity for you.
  • Any action. Steam game by AppID (Dota 2 by default), .exe / .lnk, .bat / .ps1 / .py script, URL or shell command. Won't relaunch a game that is already running.
  • Tray app. Green = listening, yellow = looking for a mic, red = no mic, grey = disabled. Blinks on every snap. Starts with Windows, single instance.
  • Live level meter and event log that explains why a sound was accepted or rejected.
  • English and Russian UI, switchable at runtime.
  • No install required — a single SnapLauncher.exe, or run from source with Python 3.10+.

Install

Option A — SnapLauncher.exe (no Python needed)

  1. Download SnapLauncher-x.y.z-win64.zip from the latest release and unzip it.
  2. Run SnapLauncher.exe — it works right away from any folder (settings are kept in a data folder next to it).
  3. Optional: SnapLauncher.exe --install opens a small setup window that copies the app to %LOCALAPPDATA%\Programs\SnapLauncher, adds Start Menu / Desktop shortcuts, enables autostart and registers it in Apps & features for uninstalling.

Silent install for scripts:

SnapLauncher.exe --install --silent [--dir "D:\Tools\SnapLauncher"] [--no-autostart] [--no-shortcuts] [--no-launch] [--lang en]
SnapLauncher.exe --uninstall --silent

Windows SmartScreen may warn about an unsigned exe the first time — choose More info → Run anyway, or build it yourself (see below).

Option B — from source

git clone https://github.com/Msuprune/SnapLauncher.git
cd SnapLauncher
install.bat

install.bat installs the dependencies and opens the same setup window. Or run it in place:

python -m pip install -r requirements.txt
pythonw snap_launcher.pyw

First run

  1. Open the settings (double-click the tray icon). The level meter should move with room noise — the mic is live.
  2. Press Calibrate and snap your fingers 3–5 times within 6 seconds.
  3. Press Save & apply. Snap twice — Dota 2 starts.

Too many false triggers → lower the sensitivity or raise Min HF share in Advanced. Snaps not detected → raise the sensitivity, get closer to the mic, or switch Listen for to Hand claps / Any sharp sound.

Settings

Section What you can change
General language, start with Windows, beep, tray notification
Microphone Auto (finds a real microphone) or a specific device; live level meter; calibration
Detection sensitivity 1–10, listen for (snaps / claps / any), snaps in a row 1–4, max gap, cooldown; advanced: min gap, max duration, dead time, attack sharpness, HF cutoff and share, manual threshold
Action Steam AppID (Dota 2 = 570), program / shortcut, script, link, command; arguments; skip if dota2.exe is running; test button
Event log every snap, rejection reason, launches

Settings: data\config.json next to the program. Log: data\snap_launcher.log.

Command line

SnapLauncher.exe                  settings window + tray icon
SnapLauncher.exe --minimized      tray only (what autostart runs)
SnapLauncher.exe --lang en|ru     force the UI language
SnapLauncher.exe --quit           ask the running instance to exit
SnapLauncher.exe --enable-autostart / --disable-autostart
SnapLauncher.exe --install [--silent ...] / --uninstall [--silent]

The same flags work with python snap_launcher.pyw; add --debug to log to the console. A second launch never creates a second copy — it just opens the settings window.

How detection works

mic → 10 ms blocks → peak, RMS, HF share (FFT)
        │
        ├─ noise floor (adaptive)  → gate = floor × SNR
        ├─ onset: peak ≥ threshold, ≥ gate, ≥ attack × previous peaks, HF ≥ min
        ├─ must fade within 120 ms, otherwise rejected (voice / music)
        └─ sequence: N confirmed snaps with 100–700 ms gaps → action, then cooldown

Sensitivity 1–10 maps logarithmically to the peak threshold (−6 dBFS … −30 dBFS) and linearly to the SNR and attack ratios. The calibration measures the median peak of your snaps and sets the threshold at 45 % of it.

Development

pip install -r requirements-dev.txt
python tests\test_detector.py      # 16 synthetic tests: double snap, voice, bass, noise, cooldown…
python build.py                    # dist\SnapLauncher.exe + zip (PyInstaller)

Project layout:

snap_launcher.pyw    entry point / CLI flags
app/config.py        settings, paths
app/audio.py         microphone enumeration and auto-selection
app/detector.py      snap detector (pure numpy, testable)
app/worker.py        audio thread, reconnect, calibration
app/actions.py       launching things, process check
app/autostart.py     HKCU Run key
app/singleinstance.py  mutex + named events (show / quit)
app/tray.py          pystray icon and menu
app/ui.py            customtkinter settings window
app/installer.py     built-in installer / uninstaller
app/winaudio.py      Core Audio via ctypes: mute state of a capture device
app/i18n.py          UI strings (en, ru)

GitHub Actions builds the exe on every push and attaches the zip to a release when a v* tag is pushed.

Credits

Ideas borrowed from jarvis-clap, clapDetection and snap-detector. Built with sounddevice, customtkinter and pystray.

License

MIT

About

Snap your fingers twice to launch Dota 2 (or any program). Windows tray app with adaptive snap detection, calibration, autostart and EN/RU UI.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages