Spank for windows!
Slap your laptop, it yells back. no accelerometer needed, just your microphone.
Project Title: spank-for-windows
Subtitle: A Windows-native, GUI-driven implementation of the viral "Slap your laptop" hardware-response concept.
Project Overview
spank-for-windows is a functional, interactive application that transforms physical impact on a laptop into audio feedback. Built using Go and the Fyne toolkit, this project is a Windows-native derivative of the original taigrr/spank. It leverages real-time audio sampling and amplitude-spike logic to detect "slaps" or impacts, triggering categorized audio responses based on user-selected modes.
Key Features
Real-Time Impact Detection: Uses a custom detection engine to monitor short, high-amplitude audio spikes via Windows-native audio inputs.
Dynamic Response Modes: * Pain: Random protest/pain audio clips.
Sexy: An escalating logic-based mode that increases intensity based on the frequency of impacts in a 5-minute window.
Halo: Classic death sounds inspired by the Halo franchise.
User-Friendly GUI: A clean desktop interface providing Start/Stop controls, mode toggles, and a real-time sensitivity slider to calibrate for different environments.
Optimized Build: Includes an automated
build.batfor tool verification (GCC, Go, Git), asset pulling, and full installation to%LOCALAPPDATA%.
Technical Stack
Language: Go (Golang) 1.21+
GUI Framework: Fyne (Cross-platform UI toolkit)
Audio Handling: WASAPI/COM integration for Windows audio sampling.
Build System: MinGW-w64 (GCC) for CGO bindings and resource embedding.
Technical Challenges & Implementation
The project successfully addresses the complexity of low-latency audio monitoring on Windows.
Sensor Logic: Implemented in
sensor/sensor_windows.goto handle Windows-specific audio device communication.Detection Algorithm: A spike-ratio logic in
detector/detector.gothat filters out consistent background noise while identifying sudden kinetic impacts.State Management: Tracking "slap counts" over time to allow for the escalating "Sexy" mode logic.
How to Run
Direct: Download
spank.exefrom the latest release, click Start, and select your mode.Build from Source:
Bash
git clone [repository-url] build.bat
Attribution
This is an independent derivative work inspired by the original taigrr/spank project.
Original Concept:
taigrrWindows Implementation: Developed with assistance from Claude (Anthropic) for rapid iteration and "vibecoding" the final release.
License: MIT