Ask HN: Does anyone use sound effects in their dev environment?

234 points by jack_riminton ↗ HN
It occurred to me that we often use colours in our terminals and code editors to highlight test failures, linting errors etc, but we don't typically use sounds. Has anyone integrated sound effects in any way?

335 comments

[ 2.8 ms ] story [ 342 ms ] thread
I don’t, but I can imagine someone using them for events that may take a while (e.g. build ended, tests ended, deploy ended), or particularly if the event is a failure they have to respond to.

Xcode at least used to have sounds for “build failed” and “build succeeded”, and IntelliJ gives you notifications for build and test failures when the app isn’t focused.

From my perspective, this is unnecessary overhead.
95% of my work (web dev) isn't so much waiting for something to happen, where a notification of any sort would be useful. Most builds etc only take a few seconds, so I just wait.

Most of the work is thinking through a problem, then ensuring it's coded correctly. The colors and syntax highlighting and squiggly lines and Typescript warnings etc (in Jetbrains) are all helpful because they are contextual. "Hey, this function isn't written right" or "you mapped this array to an invalid return type" let me know exactly what I did wrong so I can fix it.

I don't think random beeps and dings and pewpews would have the same kind of contextual usefulness, and would probably be annoying and take me out of the zone whenever I'm focused and coding.

Mostly agree but this does give me an idea: having a sound that indicates a change you just made to a line caused an issue with an offsceeen line. For example deleting the last usage of a variable declared higher up.

Of course there are already onscreen solutions for that, such as indicators in the minimap, but it could be more obvious as a sound.

I agree, that would be nice. It could be like RTS games, where a narrator says something like "Your code is under attack" and there's a ping on the minimap pointing at the exact line.
lol coding does feel like an RTS sometimes.

Oh shit something broke over there!

Crap I forgot to built something over here!

Bah I knew I should have tested that!

The deadline is approaching!

I used them when running some tasks. There's a shortcut for it in my dotfiles.
Sometimes when I wait for slow tasks to complete I do stuff like:

  sleep 900; say "Task X is probably done now"
On Mac this works out of the box, AFAICT Linux has similar commands.

https://ss64.com/mac/say.html

https://manpages.debian.org/bookworm/gnustep-gui-common/say....

I do this, but I put it after terminal tasks like builds or test suites like task build; say complete
thank you.

Just created an alias

alias waitfor='f() { sleep $1; say "Task $2 is probably done now"; }; f'

Why an alias creating a function and running it, instead of just defining the waitfor() function?

    function waitfor(){ sleep $1; say "Task $2 is probably done now"; }
I used this for my pipeline that deploys a fresly baked raspberry pi image onto an SD card. It would remind me to remove the SD card and put it in the Pi, boot it and have Ansible continue to configure it. Felt awesome.
I use something similar with an added "nagging" functionality. Surprisingly, it's easier for me to obey this thing, than nagging from an actual human being.

    nagme () {
        [ "$#" -ne 2 ] && printf "usage: $0 [in_minutes] [text]\n" && return 1
        printf "sleeping $1 min before telling you to $2\n"
        sleep "$(echo $1\*60|bc)"
        say "$2" > /dev/null 2>&1
        while :
        do
            sleep 30
            echo -n '.'
            say "I'm nagging you to $2" > /dev/null 2>&1
        done
    }
No, I do the opposite. I keep my speakers muted when developing. I don't want sounds. But then, I'm also one of those weirdos who prefers not to use colors as well (they hinder rather than help me), so it may just be a personality thing.
Absolutely not. Cubicle farms are noisy enough as they are. The occasional beep from an ASCII Bel character is more than enough.

I also surprise myself regularly by finding that I'm still wearing noise-cancelling headphones long, long after the Zoom or WebEx has ended. When I take the headphones off, I'm surprised again by how noisy the background is, particularly the howling of the ventilation system.

Oh man, I'm jealous that you get cubicles. When I moved from Big Corp to startup land, I did not realize how much I would miss having a cubicle.
Corps don’t do cubicles anymore either, since the pandemic it’s all open spaces with hot desks
I bashed the cubicle 15 years ago - nowadays would kill to work with 2 more folks around, even if only a couple days a week.

(Coffee shops don't really work for me...)

Other than 3 hours where I modified git push to play "Push It" by Salt-N-Pepa before it got annoying, nope.
One of my friends old office had speakers and every time Jenkins failed with a build it made a short sound. It was different for each project so everyone familiar with the sound would instantly know which project pipeline failed. He liked it and had fun choosing a sound effect fitting for his own project :)
I sat next to someone who had a similar set up, except a robot voice also read out a summary of the failures.

I moved desk within a few hrs.

One place I worked at the success was a golf clap. The fail was crowd going 'awwww' as if someone had just missed a putt. Nice and simple. Since the build took 3-4 hours you did not hear it much.

Before everyone went 'open office' it was semi fun to have sounds on different build actions. Now not so much :(

There’s… a particular sound pack that had those two sounds. Maybe different ones, sure, but this just unlocked a memory of two very particular sounds from my early Windows days. Might have been built-in, or maybe from Microsoft Plus.
That is very possible. Pretty sure we scrapped it off some random sound site.
I don't personally but then again most of my work is not asynchronous in nature.

A friend of mine has a TSR application that plays sounds to simulate as if they had a mechanical keyboard which they use with their laptop. So that's something.

I use a mechanical keyboard at home and I can absolutely see the 'tacking' sounds that it makes as a form of audio feedback
It isn't exactly what you have in mind, but I use `play` as well as a terminal theme color change to tell me when I'm using one or another language's keyboard layout. If you put & in front of play, you can make chords.

Here's an example:

    # Define notes for major seventh chord starting on A 440
    A=440
    C_SHARP=554.37
    E=659.25
    G_SHARP=830.61

    if [[ "$layout" == "Finnish" ]]; then
      # Play a major seventh chord ascending
      kitty +kitten themes --reload-in=all Apprentice &

      play -n synth 0.2 sine $A vol -30dB &
      play -n synth 0.2 sine $C_SHARP vol -30dB &
      sleep 0.2
      play -n synth 0.2 sine $E vol -30dB &
      play -n synth 0.2 sine $G_SHARP vol -30dB &
    elif [[ "$layout" == "English (US)" ]]; then
      kitty +kitten themes --reload-in=all Default &

      play -n synth 0.2 sine $G_SHARP vol -30dB &
      play -n synth 0.2 sine $E vol -30dB &
      sleep 0.2
      play -n synth 0.2 sine $C_SHARP vol -30dB &
      play -n synth 0.2 sine $A vol -30dB &
    fi
I used the same approach when programming my fridge. If the compressor was required because the temperature in the topmost shelf was too high, the tones would play in rising order. If it was due to the bottom shelf, then the tones would play in descending order.

I ended up disabling the feature because it was always the bottom shelf.

Is your fridge on GH? Mine is outdated and I'd like to download a newer one.
Short answer: no.

Was forced to move to a new place. Had to buy a secondhand fridge. Thermostat was out of whack. Instead of calling a technician, I decided to have fun, replaced the thermostat by an Arduino with a couple of thermometers (top shelf, bottom shelf), a relay driving a contactor, and a beeper. Firmware stayed in "beta version", never thought about publishing it.

When I moved again to a new place I ditched the frankenfridge.

Projects line Frankenfridge are a blast until you want a product that "just works".
Most of my longest lived and lowest maintenance things were frankenprojects and brazen hacks that somehow lasted years without me having to make any changes or fix anything.
Things work surprisingly well when you don't have an engineer or two figuring out how cheap you can go.
I bet it's written from an Apple device :)
that project deserves a permanent web presence, if only a blog post!
When I read that Finnish was a major seventh I was hoping that English would be a minor seventh or something even more subtly different. A minor 7th vs a minor 7 flat 5 etc.

Would be funny to create an elaborate system of notification tones that are only discernible by a trained musician

Forgive me Mr. Ghost Pepper. I didn't take the ear training seriously enough in AP Music Theory, and now I can scarcely tell my eleventh chords apart when I'm listening to Charles Mingus!
> Would be funny to create an elaborate system of notification tones that are only discernible by a trained musician

Oh man, could this concept be turned into an esoteric programming language where to program you use a musical keyboard and all the symbols in your lang are different chords or intervals

Absolutely no visual feedback for extra pain

Forking each sox command to the background causes samples to play non-deterministically and step over each other. Here's a better way:

    # Define notes for major seventh chord starting on A 440
    A=440
    C_SHARP=554.37
    E=659.25
    G_SHARP=830.61

    case "$layout" in
    Finnish)
      kitty +kitten themes --reload-in=all Apprentice &
      play "|sox -np synth 0.2 sine $A" \
           "|sox -np synth 0.2 sine $C_SHARP" \
           "|sox -np synth 0.2 sine $E" \
           "|sox -np synth 0.2 sine $G_SHARP" \
           vol -30dB 2>&- &
      ;;
    'English (US)')
      kitty +kitten themes --reload-in=all Default &
      play "|sox -np synth 0.2 sine $G_SHARP" \
           "|sox -np synth 0.2 sine $E" \
           "|sox -np synth 0.2 sine $C_SHARP" \
           "|sox -np synth 0.2 sine $A" \
           vol -30dB 2>&- &
      ;;
    *) echo >&2 'Invalid $layout - must be "Finnish" or "English (US)"'; exit 1
    esac
Relatedly, I once saw someone realize that the sound they played at the end of their build was running synchronously so they were blocking themselves from a faster feedback loop and reporting unusually long builds in their profiling. Properly backgrounding the sound fixed their issues.
Stepping over each other was the point! :) But very good to know if I ever want to encode a little melody instead!
No - in fact I habitually leave my speaker muted, to prevent programs like Slack from distracting (and likely irritating) my co-workers in the office.
I play different wav files when compile fails or succeeds, so I don’t need to switch to terminal from the editor. This in addition to Anybar(1) red/green icons.

1. https://github.com/tonsky/AnyBar

Many years ago I had a manager who set a sound on our monitoring system to make a noise every time we got an alert. It went off non-stop and everyone started yelling at him until he turned it off.
Only a little bit. I have VS Code configured to emit a small sound when a terminal command fails, or when a debugging breakpoint is hit. I also used to add `; say "tests are done"` to my test command so I could go to another screen and know when my tests finished.
I configured my Xcode behaviors to play a sound when a build is completed or when the test fails/passes.
https://github.com/kristiandupont/react-geiger

This plays a click when React components rerender, to make you aware of the page performance

This one does the same thing but with beeps, with higher pitch for heavier DOM updates. It’s not as nice as the geiger click but I’ve found it more useful for figuring out exactly where the UI is slow.

https://github.com/tomhicks/react-audible-debug

I'd love one for React-native, might look into making one if I don't find any :D
I think in case of React the core idea is simple. For example I would love something like this for Rails ActiveRecord to help you find n+1's by sound
I sometimes use sounds as opposed to print statements when debugging automations or certain UI behavior, e.g. to indicate whether a certain if-condition was triggered or not.

The advantage over normal print debugging is that you get immediate feedback, and do not need to switch to a console. This is also useful when it comes to debugging split second timings (custom window movement scripts).

You just gave me the idea for a tool that watches log files and plays sounds when certain patterns occur.
HELL YES!

I actually did set my shell to spawn a background task to play the vine boom whenever I entered an invalid command.

Something like

    command_not_found() {
      pw-play /opt/boom.opus &
    }
And it actually improved my command accuracy by a lot. And it was super fun.
I buzz in ahk on timeout paths (e.g. dialog failed to show), also signal the end of lora training (half an hour+). Tried to voice over tsc -w errors, but that got old quickly.

I work in automation so sending an IM in case something’s wrong (or finished) is not a rare thing. May count as a sound too. I also shoot videos of everything a visual script does for debug (xvfb, ffmpeg).

The dude in the cubicle next to mine used to use sound effects extensively, but he died a mysterious death a while ago...
Choked on a speaker?
No idea what you're talking about...?!
Terminals have supported a bell since terminals existed. The moment I hit tab on an interactive shell and it bleeps, I make sure it never does that again or my SO can't sleep.