0

I wrote myself a script to check a thing periodically. I'd like to make some sound notification for it.

I tried this

a = new Audio()
a.src = "file:///usr/share/sounds/LinuxMint/stereo/desktop-logout.ogg"
a.play()

but this fails silently.

How should I play a local file from pure JavaScript?

marmistrz
  • 5,974
  • 10
  • 42
  • 94
  • Why don't you just move the sound file into the dir your script is? If you could access one's file system just like that, I could easily write a snippet here that could fetch ALL your files. – Shomz Feb 03 '16 at 15:08
  • This doesn't help either. I've explained why – marmistrz Feb 03 '16 at 17:48

0 Answers0