Skip to Main Content

Spank for windows!

Slap your laptop, it yells back. no accelerometer needed, just your microphone.

Description

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.bat for 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.

  1. Sensor Logic: Implemented in sensor/sensor_windows.go to handle Windows-specific audio device communication.

  2. Detection Algorithm: A spike-ratio logic in detector/detector.go that filters out consistent background noise while identifying sudden kinetic impacts.

  3. State Management: Tracking "slap counts" over time to allow for the escalating "Sexy" mode logic.

How to Run

  1. Direct: Download spank.exe from the latest release, click Start, and select your mode.

  2. 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: taigrr

  • Windows Implementation: Developed with assistance from Claude (Anthropic) for rapid iteration and "vibecoding" the final release.


License: MIT

Issues & PRs Board
No issues or pull requests added.