An unofficial, read-only Hacker News reader.

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

905 points by gaurang_tandon 3 days ago | buttons.joshwcomeau.com | 136 comments on HN

View full thread · View on Hacker News

Comment thread (11)

  1. > Frustratingly, browsers can decide to block a website from playing any sound. iOS Safari seems particularly strict about this. So, if you’re not hearing a click sound when tapping the big red button, please check out this website on a desktop computer.

    While I understand this behavior from Apple in a user-first perspective and do find audio on mobile web to be annoying in most cases, an easy way to allow audio to play on an iPhone that isn't "use a desktop" seems to be flipping the hardware switch to turn off silent mode.

    I'm not proud to admit it took 5 minutes of poking and a Google/Gemini search to figure that out...

    Replies (3)
    1. Dev should be able to work around it though a minimum one user tap on page should be required, IIRC.

      RE: your solution - For iPhones with action buttons, can disable silent mode in control center.

    2. Having audio in the browser respect the silent mode switch seems perfectly reasonable.

      I would find it frustrating if my phone was set to silent and it played button noises on a website.

      Replies (1)
      1. I believe the intent of the silent switch is to silence the ringer, not to mute the whole OS. For example, music keeps playing at the selected volume even when you activate silent mode.

        However, a bunch of 3rd-party apps misinterpreted the meaning of this signal, so for example, a number of popular games mute all of their audio when the silent switch is enabled, meaning I have to un-silence the ringer just to hear game audio.

        Replies (1)
        1. I like to think of it more like an unplanned audio silent switch.

          With a timer or alarm, I explicitly want to be interrupted so those break through.

          With music or a video that I’m explicitly starting, I want I to break through.

          For anything else that may be background noise that I’m not expecting, like any auto-play music/videos in the browser, sound effects, phone calls, texts, and game noise… I want it to respect the silent switch.

          We’ve all seen, or been, the person who opens something on our phones in a public place that is quiet, to have the phone start playing something unintentionally. It can often be rather embarrassing. A silent switch with broad application prevents almost all of this.

          I understand where you’re coming from, and I think it would require a separate switch. One for the ringtone, and one for the idea I’m talking about. But this might get even more confusing for the users.

          If there is a game you play often that you want audio for, a shortcut could be setup to automatically turn silent mode on/off when the app is opened or closed. I was looking to see if there was a game mode trigger to apply more broadly, but it doesn’t look like it.

          I do see an option in the Sound & Haptics settings to match Alerts and System Sounds to the ringtone volume. I wonder if turning that off would move the silent switch to a pure ringtone mute, like you want? It’s worth a shot.

    3. 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.