A Windows application that plays customizable sounds when you type, with optimized performance and low latency.
- Plays custom sounds for key presses and releases
- Multiple sound packs support
- Adjustable volume control
- Latency optimization settings
- Clean UI
- Minimal resource usage
This application is built using modern C++17 and integrates several technologies:
-
Low-Level Keyboard Hook System
- Uses the Windows
SetWindowsHookExAPI to capture keyboard events globally - Implements intelligent filtering to avoid double-firing on auto-repeat
- Detects injected keystrokes to avoid processing artificial input
- Uses the Windows
-
Predictive Sound Preloading
- Learns typing patterns to predict which keys are likely to be pressed next
- Preloads sound buffers for commonly typed sequences
- Prioritizes frequently used keys for minimal latency
-
Multi-threaded Sound Processing
- Dedicated sound processing thread to avoid UI blocking
- Priority queue system to handle rapid keystroke sequences
- Intelligent cleanup of stale sounds to minimize memory usage
-
SFML 3.0 Audio Integration
- Uses the latest SFML 3.0 audio system for high-quality, low-latency sound
- Properly implements sound buffer caching and reuse
- Manages sound resource cleanup automatically
-
Dynamic Performance Tuning
- Four optimization levels to balance between latency and resource usage
- Automatically adjusts processing behavior based on typing speed
- Smart rate limiting to prevent audio clipping during fast typing
- KeyboardHookManager: Captures and processes keyboard events
- SoundManager: Handles sound file loading and selection
- SFMLSoundPlayer: Manages sound playback and caching
- Application: Provides UI and coordinates other components
- Windows 10 or later
- CMake 3.14 or newer
- C++17 compatible compiler (e.g., Visual Studio 2019+, MinGW-w64)
- SFML 3.0 (not included)
- Download SFML 3.0 from the official website
- Extract the SFML package
- Create a
libsfolder in the project root - Create an
SFMLfolder inside thelibsfolder - Copy the contents of the SFML package into the
libs/SFMLfolder- Ensure the folder structure looks like:
libs/SFML/bin,libs/SFML/lib, etc.
- Ensure the folder structure looks like:
# Clone the repository
git clone https://github.com/aledlb8/keyboard-sounds.git
cd keyboard-sounds
build.batThe executable will be created in the build folder (Release configuration). Required DLLs from SFML will be automatically copied to the build folder.
To run the application:
cd build
./keyboard-soundsIf you don't want to build from source, you can download the pre-built release packages from the Releases page.
- Download the latest release ZIP
- Extract to a folder of your choice
- Run
keyboard-sounds.exe
- Check the sounds folder, you can add your custom ones without changing a single line of code!
The application offers four optimization levels that balance between performance and resource usage:
- Minimal: Better compatibility, less resource usage
- Low: Basic optimization with minimal preloading
- Medium: Balanced optimization (default)
- Maximum: Lowest possible latency, higher CPU/memory usage
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- SFML for the excellent audio library
- All contributors and testers who helped improve this application