Skip to content

Repository files navigation

🍺 SkufUp — Beer Can Opening Detector

🌐 Language:
English Русский Deutsch Español Français 中文 Čeština Nederlands

🍻 56 cans of beer were consumed during development 🍻

Beer Detection

Open a beer → Game launches

Python Windows ML License


🎯 What is this?

SkufUp listens to your microphone and waits for the characteristic "pshhh" sound of opening a beer can.
When it hears it — automatically launches a game or opens a website!

Before beer 😢 After beer 🍺
➡️

✨ Features

  • 🤖 ML Detector — trained on real recordings, ~95% accuracy
  • 🎮 Process Check — won't open the game if it's already running
  • 🌐 Website Support — can open any URL
  • 🚀 Autostart — launches with Windows
  • 🎨 Beautiful Interface — dark theme, minimalist design

📦 Installation

Option 1: Ready-made Installer

Download SkufUp_Setup.exe from Releases and run it.

Option 2: From Source

# Clone the repository
git clone https://github.com/your-username/SkufUp.git
cd SkufUp

# Install dependencies
pip install -r requirements.txt

# Run
python gui_app.py

🚀 How to Use

How to use

  1. Launch SkufUp
  2. Choose a game (.exe) or specify a website
  3. Press START
  4. Open a beer 🍺
  5. Enjoy! 🎮

🔧 How the ML Detector Works

🎤 Microphone → 📊 Audio Analysis → 🤖 ML Model → ✅ Beer!
Step Description
1️⃣ Microphone records sound in real-time
2️⃣ Features extracted: spectrum, envelope, frequencies
3️⃣ RandomForest classifies: beer or not
4️⃣ Additional checks: H/L ratio, centroid, duration
5️⃣ If everything matches → launch game/website

Characteristic features of "pshhh":

  • 📈 High frequencies (2-8 kHz) — gas hissing
  • ⚡ Fast attack — sudden onset
  • 📉 Short duration — 100-500 ms

📁 Project Structure

Source Code/
├── gui_app.py              # 🖥️ Main application with GUI
├── audio_detector_ml.py    # 🤖 ML sound detector
├── audio_detector.py       # 📊 Basic detector (fallback)
├── train_model.py          # 🎓 ML model training
├── analyze_audio.py        # 📈 Audio file analysis
├── config.py               # ⚙️ Settings
├── beer_sound_template.py  # 🍺 Reference sounds
├── build_installer.py      # 📦 Installer builder
└── requirements.txt        # 📋 Dependencies

⚙️ Configuration

Open config.py:

DETECTOR_SETTINGS = {
    "similarity_threshold": 0.45,  # Similarity threshold
    "peak_threshold": 0.1,         # Volume threshold
    "cooldown": 3.0,               # Pause between triggers
    "debug_mode": True,            # Show logs
}
Problem Solution
False positives Increase similarity_threshold to 0.55-0.60
Doesn't catch can Decrease similarity_threshold to 0.40
Too frequent triggers Increase cooldown to 5-10 sec

🛠️ Building .exe

# Build application
pyinstaller SkufUp.spec --noconfirm

# Create installer
python build_installer.py
pyinstaller --onefile --windowed --name=SkufUp_Setup --icon=setup.ico SkufUp_Installer.py

🎓 Training Your Own Model

If you want to improve accuracy:

# 1. Put your recordings in sound/ folder
# 2. Analyze
python analyze_audio.py

# 3. Train model
python train_model.py

# 4. Rebuild exe
pyinstaller SkufUp.spec --noconfirm

🐛 Debugging

Enable debug_mode: True and watch the console:

🔈 [████████░░░░░░░░░░░░] RMS:0.023 Peak:0.089
🔊 [████████████████████] RMS:0.156 Peak:0.423
   🤖 ML probability: 89% | H/L: 15.2 | Centroid: 8500Hz
🍺 CAN OPENED! (ML: 89%, H/L: 15.2)

🍻 Enjoy your beer!

Cheers

Made with 🍺 and ❤️

About

🍺 Детектор звука открытия пива - запускает игру когда слышит "пшик"

Resources

Stars

41 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages