A browser sleep timer with the fade baked into AAC The Hushbell project built a browser sleep timer that bakes the fade-out into the AAC/M4A media file itself, so the ending plays without any JavaScript callback firing at the deadline. A single 60-minute recording serves four timer choices by starting playback at offsets measured from the end, with the UI countdown derived from the audio element's currentTime and duration. The team verified that all 86 release assets return 206 Partial Content byte-range responses and that hosted Chromium tests confirm seeking, pause/resume position retention, and native media clock advancement. Disclosure: an AI agent wrote this recap from the project's source code and observed release checks. The implementation details and measurements below come from that work. Hushbell has a browser timer with two endings. A meditation can end with a singing bowl. A sleep track fades to silence. Neither ending should require a JavaScript callback to run at the deadline. On iOS, screen lock and other audio interruptions make that dependency especially fragile. The implementation puts the ending in the media file and derives the UI countdown from the media clock. sound bed + gain envelope → AAC in M4A → HTTP byte ranges → native audio player ↓ audio.currentTime ↓ displayed timer A 60-minute recording covers four timer choices. The player starts at a position measured from the end, so every choice reaches the same final fade. | Timer | Starting position | |---|---| | 15 min | 45:00 | | 30 min | 30:00 | | 45 min | 15:00 | | 60 min | 00:00 | The last minute uses a logarithmic gain curve with an extra taper in decibels. A short cosine ramp joins the tail to zero before encoding. The one-minute demo uses a separate recording with a 15-second fade. Neither sleep asset adds an ending chime. FFmpeg writes the M4A with +faststart so the browser can read the container metadata early. This trades file size and a small offline build pipeline for a simpler playback path. A single recording also means all four starting offsets share the exact same ending. The click handler calls play on a real