Case study

mochi

C++CMake

Overview

A tiny Windows tray app that plays satisfying keyboard and mouse sounds. 12 keyboard voices, 4 mouse packs, low latency, a global mute, and a light installer.

Problem

Mechanical-keyboard fans like the sound of typing, but they don't want a heavy Electron app or a settings window always in the way. The experience should stay quiet in the background while still covering both keyboard and mouse audio.

Approach

I built a lightweight C++17 Win32 app that captures global keyboard and mouse input through Raw Input and plays recorded switch audio using miniaudio's WASAPI backend. Everything is run from a native, Windows-aware tray menu: profiles, mouse packs, volume, mute, release sounds, updates, and launch-at-sign-in.

Architecture

A native Win32 tray application runs without a visible desktop window. InputManager handles global Raw Input and hotkeys; AudioEngine uses miniaudio voice pools for overlapping, low-latency WASAPI playback; Config persists settings atomically in %APPDATA%; and TrayMenu owns the native controls and notifications. Python generators turn profile and audio metadata into compiled resources, while CMake and PowerShell build the application and installers.

Challenges

Fast typing cuts sounds short unless playback can overlap, so the audio engine pools voices. Global input needed key-repeat suppression and resilient key-up handling. Mochi also supports both single-file and per-key sound packs, custom runtime packs, single-instance protection, and two self-contained installer formats without dragging in a big runtime.

Results

A focused Windows 10/11 tray app with 12 keyboard voices, 4 mouse packs, independent master and profile volume (50–200%), a Ctrl+Shift+M global mute, optional key-release sounds, custom sound-pack discovery, and light/dark tray menus. The official EXE and MSI installers bundle every pack and ship separately from the private source.

Technology

C++17CMakePython

Support mochi (vote)

mochion App Builders PH
Email copied