Skip to content

Mosss-OS/SONER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SONER — Clap-Triggered Product Launch Engine

SONER listens for a double clap on your microphone and launches your daily product-building stack: terminal at the project directory, Slack, Brave browser, and optionally a welcome message via ElevenLabs TTS.

A native PySide6 desktop window shows real-time audio levels, clap indicators, status, and a live log.

Demo

Clap twice → terminal opens at ~/Desktop, Slack launches, Brave opens, and you're ready to build.

Features

  • Double-clap detection — configurable sensitivity, spike ratio, noise floor adaptation, and timing windows
  • Desktop GUI — dark-themed PySide6 window with RMS meter, clap dots, status badge, and scrollable log
  • Product launch stack — opens terminal, Slack, and Brave on double clap
  • Smart launch — only opens apps that aren't already running (terminal & Brave)
  • ElevenLabs TTS — welcomes you with a cached, customizable spoken phrase
  • Real-time noise adaptation — continuously tracks noise floor and adjusts threshold automatically
  • Linux-optimized — built and tested on Linux Mint (X-Cinnamon)

Requirements

  • Python 3.11+
  • A working microphone
  • gnome-terminal (for terminal launch)
  • Slack (for team communication)
  • Brave Browser (for web/research)
  • ElevenLabs API key (optional, TTS skipped without it)

Setup

# Clone and enter the directory
git clone https://github.com/Mosss-OS/SONER.git
cd SONER

# Create a virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Configuration

Edit the constants at the top of soner.py:

Constant Default Description
SAMPLE_RATE 48000 Audio sample rate; try 44100 if your device doesn't support 48000
INPUT_DEVICE 4 Microphone device index; None for system default
SPIKE_RATIO 3.0 Higher = fewer false triggers; lower = catches quieter claps
MIN_RMS 0.005 Absolute floor for spike detection (helps in quiet rooms)
COOLDOWN_S 0.45 Minimum seconds between double-clap actions
MAX_DOUBLE_GAP_S 0.40 Maximum gap between the two claps
BLOCK_MS 50 Audio analysis window in milliseconds
WORK_DIR ~/Desktop Directory the terminal opens to

Environment variables (.env file)

Create a .env file in the project root:

ELEVENLABS_API_KEY=your_key_here
ELEVENLABS_VOICE_ID=your_voice_id_here

Without ELEVENLABS_API_KEY and ELEVENLABS_VOICE_ID, the welcome speech is skipped (all other actions still run).

Run

# With GUI
python soner.py

# Headless (no GUI — just audio detection and logging)
# Set SHOW_GUI=False in soner.py or modify MainWindow logic

The window title reads SONER - Clap Listener. Stop with Ctrl+C.

How It Works

  1. sounddevice reads the microphone in blocks
  2. Each block's RMS energy is compared to an adaptive noise floor
  3. A spike above noise_floor * SPIKE_RATIO (and at least MIN_RMS) triggers a clap event
  4. Two claps within MAX_DOUBLE_GAP_S = double clap detected
  5. Actions run in a background thread:
    • Spotify URI opens in browser
    • Claude opens in Brave (monitor 1)
    • Binance BTC opens in Brave (monitor 3)
    • Windsurf focuses/opens
    • ElevenLabs welcome plays (once per process)

Tuning Tips

Symptom Fix
False triggers on background noise Raise SPIKE_RATIO (e.g., 6.0–8.0) or MIN_RMS
Claps not detected Lower SPIKE_RATIO (e.g., 2.0–3.0) or clap closer to the mic
Input Overflow warnings Raise BLOCK_MS (e.g., 150–200)
Double clap not registering Widen MIN_DOUBLE_GAP_S / MAX_DOUBLE_GAP_S

Project Structure

├── soner.py           # Main application
├── requirements.txt   # Python dependencies
├── README.md          # This file
├── .env              # Environment variables (not tracked)
├── .gitignore        # Git ignore rules
└── .cache/           # Cached TTS audio (auto-created)

Acknowledgments

Based on the original jarvis concept by hectorg2211. Rewritten with PySide6 GUI, Windsurf support, adaptive noise floor tuning, and multi-monitor Brave window management.

License

MIT

About

SONER — Clap-triggered desktop assistant. Double-clap to open Spotify, Brave, Windsurf, and hear ElevenLabs TTS. Features a real-time PySide6 GUI with audio meter.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages