# sound-alert.js

> Play Sound Alerts

Latest version **0.0.4** (published 2018-08-06) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install sound-alert.js
pnpm add sound-alert.js
yarn add sound-alert.js
bun add sound-alert.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2018-08-06 |
| First published | 2018-08-06 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Azer Koçulu |
| Maintainers | beenotung |
| Keywords | sound, html5, audio, player, play, alert |

## Links

- npm: https://www.npmjs.com/package/sound-alert.js
- Repository: https://github.com/beenotung/sound-alert.js
- Homepage: https://github.com/beenotung/sound-alert.js#readme
- Issues: https://github.com/beenotung/sound-alert.js/issues
- npm.io page: https://npm.io/package/sound-alert.js

## Dependencies (1)

- [play-audio.js](https://npm.io/package/play-audio.js.md) ^0.0.7

## Recent versions

- 0.0.4 (latest) — 2018-08-06
- 0.0.3 — 2018-08-06
- 0.0.2-docv2 — 2018-08-06
- 0.0.2-doc — 2018-08-06
- 0.0.2 — 2018-08-06

## README

## sound-alert.js
[![npm Package Version](https://img.shields.io/npm/v/sound-alert.js.svg?maxAge=2592000)](https://www.npmjs.com/package/sound-alert.js)

JavaScript library to play sound alerts 

```js
alert = require('sound-alert.js')

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

See `content.js` for all available sounds.

Try it at
* [requirebin](http://requirebin.com/?gist=6050220)
* [jsbin](http://jsbin.com/enobox/1/edit)

## Install

```bash
$ npm install alert
```

## Manual

### Available Sounds

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

### Adding Custom Sounds

```js
alert.content['foo'] = ['http://bar.com/foo.mp3', 'http://bar.com/foo.ogg']
alert('foo')
```

## How to use without NPM?

If your application isn't structured as a CommonJS package, you can download the distribution file;

```bash
$ wget https://raw.github.com/azer/alert/master/dist/alert.js
```

And include it on your page:

```html
<script src="alert.js"></script>
<script>
  playAlert('purr')
</script>
```

### Accessing Audio API

```js
alert.player.src()
// => foobar.mp3

alert.player.on('ended', function(){})
```

More info is at [azer/play-audio](http://github.com/azer/play-audio)

---
_Source: https://npm.io/package/sound-alert.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
