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

+3


source to share


2 answers


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.

+4


source


You can not. Imagine how frustrating it would be ... I could do it, for example:

console.log(new Array(100000).join('\x07'));

      



And you will get 99999 beeps.

+3


source







All Articles