buzz
Version:
Buzz, a Javascript HTML5 Audio library
44 lines (29 loc) • 1.26 kB
Markdown
{:.intro} [Buzz](http://buzz.jaysalvat.com) is a small Javascript library that
helps you to easily include and manage sounds in your websites using the
[](https://developer.mozilla.org/en/docs/Web/HTML/Element/audio).
It degrades silently on non-modern browsers.
[](/) is written by [Jay Salvat](http://jaysalvat.com) and licensed under
the [MIT](https://opensource.org/licenses/MIT) License.
{:.button} [ Download Buzz!
{:.button} [ Fork it on Github ](https://github.com/jaysalvat/buzz)
Download the [ZIP file](
[](https://cdnjs.com/libraries/buzz).
https://cdnjs.com/libraries/buzz
Or install it by [NPM](https://www.npmjs.com/package/buzz).
$ npm install --save buzz
Or install it by [Bower](https://bower.io).
$ bower install --save buzz
```
var sound = new buzz.sound("/sounds/sound", {
formats: [ "ogg", "mp3", "aac" ]
});
sound.play()
.fadeIn()
.loop()
.bind("timeupdate", function() {
var timer = buzz.toTimer(this.getTime());
document.getElementById("timer").innerHTML = timer;
});
```