Alert
JavaScript library to play sound alerts
Install / Use
/learn @azer/AlertREADME
alert
JavaScript library to play sound alerts
alert = require('alert')
alert() // Plays default alert "bottle"
alert('purr')
alert.volume(0.5)
See content.js for all available sounds.
Try it at
Install
$ npm install alert
Manual
Available Sounds
- bottle (default)
- glass
- funk
- morse
- purr
- tink
- submarine
Adding Custom Sounds
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;
$ wget https://raw.github.com/azer/alert/master/dist/alert.js
And include it on your page:
<script src="alert.js"></script>
<script>
playAlert('purr')
</script>
Accessing Audio API
alert.player.src()
// => foobar.mp3
alert.player.on('ended', function(){})
More info is at azer/play-audio
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
