alert-sound-notify
JavaScript library to play sound alerts
playAlert = // Plays default alert "bottle"playAlert
See content.js
for all available sounds.
Try it at
Install
$ npm install alert-sound-notify
Manual
Available Sounds
- bottle (default)
- glass
- funk
- morse
- purr
- tink
- submarine
Adding Custom Sounds
playAlertcontent'foo' = 'https://bar.com/foo.mp3' 'https://bar.com/foo.ogg'
How to use without NPM?
If your application isn't structured as a CommonJS package, you can download the distribution file;
$ wget https://raw.github.com/rajvantchahal/alert-sound-notify/master/dist/alert-sound-notify.js
And include it on your page:
Accessing Audio API
playAlertplayer// => foobar.mp3 playAlertplayer