This week the developer Cody Collier published nospeaker, a small open-source app (MIT licence) that mutes your MacBook and then talks anyway, through the trackpad. There is no speaker in a MacBook trackpad. The click you feel when you press it is made by a haptic motor under the glass, Apple’s Taptic Engine, which gives the glass a short jolt. nospeaker drives that motor much, much faster than it was meant to go, and the glass starts to sing.

How can a MacBook trackpad talk with no speaker? · 42-second film · Watch with transcript

Try it yourself in Haptic Speaker Lab: speed up the taps from felt clicks to a heard tone, then speak a vowel as two tones.

From clicks to a tone

A single tap is a click you feel. Three taps a second are three clicks: your finger and your ear can count them. Something changes as you speed up. Above about 20 a second, a train of clicks stops sounding like separate events and fuses into a pitch, and the number of taps per second becomes the frequency of the note in hertz. A hundred taps a second is a low hum; a thousand is a clear tone. nospeaker can fire the motor up to about 4,000 times a second. The glass moves back and forth with every jolt, pushes on the air above it, and that is sound.

It is not a good speaker. The motor was built for short taps, not for sound, so it is quiet, and how loud it gets depends on the note. Collier measured every semitone with the MacBook’s own microphone: the trackpad is loud from about 100 Hz to 4 kHz, with a few dead spots where the glass resonates, and its loudest, cleanest notes are around 1 kHz. That happens to be where much of what makes speech understandable lives.

Two tones for a voice

A voice is far more than one tone. Your vocal folds buzz, making a whole row of harmonics, and your throat and mouth ring at a few resonances, the formants, which make some harmonics loud and others quiet. The first two formants, F1 and F2, are enough to tell most vowels apart: in an average man’s voice “ee” rings at about 270 and 2,290 Hz and “ah” at about 730 and 1,090 Hz, the classic averages measured by Peterson and Barney in 1952.

nospeaker uses exactly that. macOS’s own voice speaks the line into memory; every 10 ms, a method called linear prediction finds the voice’s two strongest resonances, its loudness and its pitch. The motor plays those two resonances as two tones, restarted on every beat of the pitch so they buzz like a voice instead of whistling. Two tones keep enough of the vowel to follow, especially when you read along, and throw away everything else: the dozens of other harmonics that make a voice sound like a person. That is why it sounds robotic.

A hack, with a caveat

nospeaker reaches the motor through MultitouchSupport, a private framework macOS uses for the trackpad, and hands it short lists of sine tones. Because that framework is private and undocumented, a macOS update could break the app.

How the model works

Haptic Speaker Lab is a teaching model, not a simulation of a MacBook. The cut-away trackpad and its coil-and-mass actuator are schematic. Taps are counted exactly from the tap rate, which simplifies what nospeaker really sends the motor (lists of sine tones). The line between felt clicks and heard tone sits at the textbook 20 per second. The gold loudness curve is an illustrative shape drawn to match the README’s description, loud from 100 Hz to 4 kHz and loudest near 1 kHz; the real response is bumpier and differs between trackpads. The vowels use Peterson and Barney’s average formants for men, and “Hear it” plays an approximation through your own speakers, only when you press it.

Keep exploring

Up next

  1. 0:47Short · EngineeringWhy are jet turbine blades grown as a single crystal?
  2. 0:42Short · SpaceWhy can Google's AI chip in orbit only run in bursts?
  3. 0:46Short · PhonesHow can your phone hop from a cell tower to a satellite mid-call?

Sources & further reading

Make the next question an experiment.

Browse independent creators who make big ideas visible.

Find an explainer