Drop your phone in water and the speaker goes muffled. The usual advice — rice, hair dryer, waiting two days — mostly doesn't work. What does work, surprisingly often, is sound itself: play the right low-frequency tone and the speaker pushes the water out of its own grille.

This post explains why it works, and how little code it takes to build with the Web Audio API.

Why 165Hz?

A phone speaker is a tiny diaphragm driven by a voice coil. When it vibrates, it moves air — and anything sitting on it, including water droplets trapped in the speaker mesh.

Low frequencies move the diaphragm the furthest. At 165Hz the membrane swings with enough displacement to physically push droplets out through the grille openings. Higher frequencies (say 5,000Hz) vibrate faster but with tiny displacement — they move air, not water. That's why speaker-cleaning tones sit in the low range, roughly 100–200Hz, and why 165Hz has become the standard starting point.

It is the same principle as the water-eject feature on the Apple Watch, just done in a browser tab instead of watchOS.

The 30-line version

Everything below runs in any modern mobile browser — no app, no permissions beyond audio output:

const ctx = new (window.AudioContext || window.webkitAudioContext)(); const osc = ctx.createOscillator(); const gain = ctx.createGain(); osc.type = "sine"; osc.frequency.value = 165; // Hz — the cleaning tone gain.gain.value = 1.0; // max volume = max displacement osc.connect(gain).connect(ctx.destination); osc.start(); // On Android you can add haptics on top of the sound: if (navigator.vibrate) navigator.vibrate([200, 100, 200]); // Stop after 30 seconds, or let the user stop it: setTimeout(() => osc.stop(), 30000); 

Two details matter in practice:

  • Volume must be at maximum. Displacement scales with amplitude, so a quiet tone does almost nothing. Tell the user to turn the volume all the way up first.
  • Disconnect Bluetooth first. If the tone routes to earbuds or a Bluetooth speaker, the phone speaker never moves. Check ctx.destination is the built-in speaker by asking the user to disconnect external audio.

Three modes, not one tone

A single 165Hz sine handles light splashes. For stubborn cases, layering helps:

  1. Sound mode — the 165Hz tone, sometimes swept slowly between 100–200Hz so different droplet sizes resonate.
  2. Vibration mode — the phone's haptic motor (navigator.vibrate patterns) shakes the body while the tone plays.
  3. Deep cleaning — sound plus vibration together, with the tone sweeping up through mid frequencies (200–1,000Hz) and higher ones (up to 8,000Hz) to reach fine dust lodged deeper in the mesh.

Each mode is just a different oscillator/gain/vibration schedule on top of the same primitives.

What sound can't fix

Honesty matters here, because overclaiming gets tools flagged. Sound moves surface droplets at the grille. It does not dry a submerged phone, fix internal corrosion, or repair a damaged diaphragm. If the phone was fully underwater, the correct order is: power off, wipe the exterior, hold it speaker-down, let airflow do its work, and don't charge it while wet. No rice, no heat, no poking the grille with a pin.

The tone is one optional step for a light splash — after the safety steps, not instead of them.

Try it

I put this together as a free web tool — Fix My Speaker — with the three modes above, plus a free Android app on Google Play if you want it as an app instead of a browser tab.

If you build your own version, start with the 30 lines above and test it on a real wet phone before adding features. The physics is simple; the hard part is the UX — getting users to max volume, disconnect Bluetooth, and repeat the tone until the water stops coming out.