MacBook trackpad speaks: Nospeaker
A MacBook trackpad has no speaker, just a small haptic motor that taps the glass to simulate clicks. But a new open-source project called Nospeaker drives that motor up to 4,000 times per second, fast enough to produce audible sound. The tool turns the trackpad into a voice, making it talk, sing, rap, and even act as an instrument.
According to the report, the motor moves the glass, and when driven back and forth hundreds or thousands of times per second, the glass vibrates fast enough to create sound. The creator uses private functions in macOS's MultitouchSupport framework to control the motor. While Apple's public haptics API only offers three fixed taps, these private functions allow specifying frequency, strength, and duration for a wide range of vibrations.
The article notes that the sound is audible from about 100 Hz to 4 kHz, with the loudest and cleanest notes around 1 kHz—covering the most important part of a voice. Nospeaker uses macOS's built-in voice to speak a line, then every 10 ms analyzes the voice's two strongest resonances (formants), loudness, and pitch. The motor plays those resonances as tones, resulting in a robotic but followable voice.
The project currently works on Apple Silicon and Intel Macs with a Force Touch trackpad and macOS 12 (Apple Silicon) or macOS 13 (Intel). The developer notes it hasn't been tested on Intel Macs, Magic Trackpad, or older macOS versions. The code is a single Swift file with no dependencies, available on GitHub.