Is it possible to ring the system bell using Javascript?
I found the following answer, but it doesn't work on the HTML page:
console.log('\u0007');
How do I start the "System Call"? in nodejs
Is there a way to call the system call from Javascript?
Chrome OSX
source to share
The answer you link to works for Node because Node console.log
writes to the process's standard output . It is actually a system terminal emulator that sees the symbol BEL
and makes a beep. (Not otherwise, as if you put BEL
in a file and run cat
in this file.)
Since the browser script doesn't have access to standard outputs, you're out of luck.
However, you can use the tag <audio>
to play the sound of your choice.
source to share