An unofficial, read-only Hacker News reader.

Button Sounds – collection of professionally-recorded button clicks and presses (opens external site)

906 points by gaurang_tandon 4 days ago | buttons.joshwcomeau.com | 137 comments on HN

View full thread · View on Hacker News

Comment thread (6)

  1. The general rule is that audio in a tab on ios is banned until a user initiated event (eg a play button) plays audio. After that, audio works.

    After a lot of trial and error, I've taken to putting a button on any page I make that uses audio with the label "Click here to unmute". Have it play a silent audio clip when it's pressed. After that, audio works.

    The UI on this page should work fine on ios if the big red play button simply plays audio directly via webaudio. Who knows how it's actually coded though. It looks like an LLM's work. Probably a mess.

    Replies (4)
    1. Largely not an LLM's work as far as I can tell: https://github.com/joshwcomeau/button-sounds

      Also, here's the author's AI policy: https://www.joshwcomeau.com/ai-policy/

      They're also a somewhat active user here.

    2. > I've taken to putting a button on any page I make that uses audio with the label "Click here to unmute". Have it play a silent audio clip when it's pressed. After that, audio works.

      So anyone who wants to defy the reason for this limitation simply needs to lead the visitor to click something that doesn't reload the page? Instead of "unmute," maybe a throbbing "next" arrow or any innocuous link such as a menu item...

      I wonder if some set of navigation-like things, such as doing a history.pushState() to change the address bar, cancels what this trick would otherwise achieve.

      Replies (1)
      1. Yeah more or less. I’ve seen people put a big invisible button over the whole page that plays a silent audio clip when pressed, so any touch interaction enabled audio. Last I checked it worked fine.
    3. >After that, audio works.

      untill you get stuck in some CORS permissions nightmare like try to click through a link or expose iFrames etc this is as much W3C as it is Apple also big blocker for immersive web (webxr) permissioning just gets in the way

    4. I don’t think it is just llm slop. I’ve followed the author for years now and they are very good at what they do. They publish a lot of really thoughtful and interesting articles about a variety of niche frontend / ui design subjects.