0.0.8 • Published 4 years ago

alert-sound-notify v0.0.8

Weekly downloads
72
License
BSD
Repository
github
Last release
4 years ago

alert-sound-notify

JavaScript library to play sound alerts

playAlert = require('alert-sound-notify')

playAlert() // Plays default alert "bottle"
playAlert('purr')
playAlert.volume(0.5)

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

playAlert.content['foo'] = ['https://bar.com/foo.mp3', 'https://bar.com/foo.ogg']
playAlert('foo')

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:

<script src="alert-sound-notify.js"></script>
<script>
  playAlert('purr')
</script>

Accessing Audio API

playAlert.player.src()
// => foobar.mp3

playAlert.player.on('ended', function(){})
0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago