13 comments

  • lukeify 3 minutes ago
    I've never seen a Josh Comeau project that isn't polished to 110%.
  • masenf 2 hours ago
    > 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...

    • josephg 1 hour ago
      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.

      • harrisi 20 minutes ago
        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.

      • hunter2_ 4 minutes ago
        > 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 tabs are initially muted simply needs to lead the visitor to click something (instead of "unmute," how about a throbbing "next" arrow, or any innocuous link such as a menu item) that doesn't navigate but can give the illusion of navigating?

    • al_borland 1 hour ago
      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.

    • Barbing 2 hours ago
      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.

  • Retr0id 8 minutes ago
    Awesome, I've always wanted to build a web UI with some nice clunky toggle switches, if I ever get around to it I might use some of these samples.
  • broabprobe 1 hour ago
    This is extremely satisfying, a total joy to play around with and a huge resource for people who like clicky button sounds! Thank you for putting it together!
  • hn-aarvin 1 hour ago
    > 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.

    FYI, setting `navigator.audioSession.type` to `"playback"` will allow the sounds to play on iOS even when silent mode is on. (It defaults to `"ambient"`.)

    On iOS versions below 16.4, this won't work as reliably; there are hacks you can do with `AudioContext`^[1] instead.

    [1]: https://github.com/feross/unmute-ios-audio

  • lanewinfield 1 hour ago
    This is phenomenal and very thoughtful to offer for free. The varying in the up and down really does make it.
  • mattjoyce 28 minutes ago
    I hope more are added, would love to hear some toggles switches.
  • isomorphic 1 hour ago
    The sounds with multiple samples are very nicely done.

    For me this website spins up the fans on my M4 Pro Mac mini when running it in Firefox Developer Edition.

    Ironically, I think it's the "Whimsical Animations" ad banner.

  • functionmouse 2 hours ago
    > The sounds were recorded in the same sound-treated room using a Zoom H4 recorder, with additional processing to remove noise in Adobe Audition. The only exceptions are synth-on and synth-off, which were created digitally using the Current VST synth. All sounds are stereo.

    This is impressive, nice work, thanks for this contribution! A writeup on this process specifically could be intriguing. Just to clarify, I understand you've chosen to license the sounds themselves are under the MIT license?

  • antonvs 19 minutes ago
    IPO when?
  • anonymous908213 1 hour ago
    Very cool, the sound quality is great and the attention to detail is something to commend.
  • DonHopkins 2 hours ago
    Industrial Bakelite Klunky Resonating Rotating Springy Switch Sounds:

    https://www.youtube.com/shorts/o_n5W2I2p_M

    Switch Courtesy of the Amsterdam Bakelite Collection:

    https://www.amsterdambakelitecollection.com/collection.php

    Majestic Stone Zen Garden Gorilla Courtesy of Boeddha Beelden:

    https://www.youtube.com/shorts/YKHP_ZxneBQ

  • petarchive 2 hours ago
    [flagged]