🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

alert-sound-notify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alert-sound-notify

Play Sound Alerts

0.0.2
Source
npm
Version published
Weekly downloads
68
-9.33%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • requirebin
  • jsbin

Install

$ npm install alert-sound-notify

Manual

Available Sounds

  • bottle (default)
  • glass
  • funk
  • morse
  • purr
  • tink
  • submarine

Adding Custom Sounds

playAlert.content['foo'] = ['http://bar.com/foo.mp3', 'http://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(){})

Keywords

sound

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts