HTML5 game publishing

Making a Browser Game Feel ASMR: Layered Sound, Variation and Timing

Several samples per action, small pitch and gain variation, sustain sounds driven by animation values, audio after a gesture, a conservative mix and optional haptics.

PlayKovo Team4 min read
Games currently available on PlayKovo. Open a title to see its current listing.

Players search for "ASMR games" and "satisfying games" in large numbers, and the genre has a feature unusual in game development: it is judged almost entirely by feel. A pour, a wipe, a click. If the sound is wrong or the timing is off, the whole game falls apart, because there is nothing else holding it up. This post covers the practical techniques for making a browser game feel tactile: layered sound with the Web Audio API, small variation so repetition does not grate, matching animation timing, and optional haptics.

Why one sound file is never enough

If a player performs the same action fifty times and hears the identical sample each time, it stops being satisfying within a minute. The ear detects exact repetition quickly. There are three standard fixes, and good games use all of them:

  1. Several samples per action. Record or choose three to six variants of the same sound and pick one at random, never the same one twice in a row.
  2. Small random pitch change. A few percent of detune per play makes identical samples sound different.
  3. Small random gain change. A couple of decibels of variation avoids a mechanical feel.
const ctx = new (window.AudioContext || window.webkitAudioContext)();
let last = -1;
function playVariant(buffers, { pitch = 0.04, gain = 0.15 } = {}) {
  let i;
  do { i = Math.floor(Math.random() * buffers.length); }
  while (buffers.length > 1 && i === last);
  last = i;
  const src = ctx.createBufferSource();
  src.buffer = buffers[i];
  src.playbackRate.value = 1 + (Math.random() * 2 - 1) * pitch;
  const g = ctx.createGain();
  g.gain.value = 0.8 * (1 + (Math.random() * 2 - 1) * gain);
  src.connect(g).connect(ctx.destination);
  src.start();
}

Use decoded AudioBuffer objects for short sounds rather than <audio> elements. Buffers start with almost no latency and can overlap freely. HTML audio elements have startup delay, and their limits on simultaneous playback vary by browser.

Layer sound to the motion, not the event

A pour is not one sound. It has a start, a continuous stream and an end. If you play a single "pour" sample when the player taps, the sound ends before the animation does and the effect breaks. Instead:

  • A short start sound when the action begins.
  • A looping or long sustain sound whose gain and pitch follow the animation, such as the sand level or the drag speed.
  • A short end sound when it lands.

Drive the sustain from the same value that drives the visual. If sand flow rate is 0 to 1, set gainNode.gain.value = flow * 0.6 and playbackRate = 0.9 + flow * 0.2. Ramp changes with setTargetAtTime rather than assigning values, or every change clicks:

sustainGain.gain.setTargetAtTime(flow * 0.6, ctx.currentTime, 0.03);

Timing: animation and sound must agree

Sound that is 100 ms late reads as lag. Sound that is early reads as wrong. For tactile effects, tie both to the same timeline:

  • Trigger the sound in the same frame as the visual contact, not on the input event. If an animation takes 200 ms to reach the surface, the sound belongs at 200 ms.
  • Use easing, not linear motion. Slow in and slow out feels soft, which is the point of the genre.
  • Avoid sudden stops. Anything that halts instantly feels harsh. Decay speed over several frames.

Respect the audio rules of the browser

Browsers block audio until the user interacts with the page. Create or resume the AudioContext on the first tap or click, and do not assume it is running before then. Also pause or lower sound when the tab is hidden. Our post on audio autoplay, mute and visibility covers the details, and the pause, resume and mute handling in the PlayKovo SDK explains how to respond when the platform asks you to mute.

A mute button must exist, must be easy to find and must persist. ASMR-style games are often played in public, and a game that cannot be silenced quickly gets closed.

Keep the mix quiet and consistent

This genre's players often use headphones. Loud peaks are worse here than in any other kind of game. Practical steps:

  • Normalize all samples to the same loudness before you ship.
  • Route everything through one master gain node and set it conservatively. A DynamicsCompressorNode before the destination can catch accidental peaks.
  • Test with headphones at a normal listening level, not just speakers.
  • Never let ads, menus or rewards be louder than gameplay.

Haptics, as an optional extra

navigator.vibrate() can add a short buzz on Android browsers. It is not supported in iOS Safari, so never depend on it. Use short patterns, like navigator.vibrate(8), on meaningful moments, and give players a setting to turn it off. Always feature-detect with if ('vibrate' in navigator).

A checklist before you ship

  1. Three or more variants for every repeated sound.
  2. Pitch and gain variation on every repeated sound.
  3. Sustain sounds follow the animation values.
  4. Audio starts only after a user gesture.
  5. Mute works instantly and is remembered.
  6. Master volume is conservative, tested on headphones.
  7. Nothing breaks if audio fails to load.

The last item matters more than it looks. If a sample fails to decode, the game should still play in silence, not freeze on a loading screen. See a boot sequence that cannot hang for how to set that up.

We use optional cookies for site analytics and site advertising. You can change your choice later. Privacy policy.