Trigger System Sounds


#1

Hello people !

I’m facing a small but irritating problem while developing an app with Electron.

I’d like to play a system “error” sound when my user tries to do something that he can’t.
I could show him an error dialog box, but this would become quite painful very quickly (having to validate the dialog box and all), hence the desire to only play the sound.

I’ve searched for this feature and found that I could for example include a sound file and play it. But since OS already have error sound, why not use them?

Do anyone knows of a way to achieve that ?

For people wondering, the sound I’m thinking about is the one that Windows play when your change the volume output, for example. But ultimately, it would be nice to be able to play’em all!


#2

Maybe you can download OS specific “error” sounds and then check for the platform your app is running on, then play the sound when the user tries to do something he/she can’t. If there’s no other way ofc, and I’ve found this but it’s OSX only


#3

Yes, I thought about downloading the sound files.
But as much as possible, I’d rather not do that, because it would kind of uselessly increase my app weight and wouldn’t feel “native” depending on the OS version of my user.
I’ll keep searching :slight_smile: