Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

buzz

jaysalvat1.2kMIT1.2.1

Buzz, a Javascript HTML5 Audio library

html5, audio, library, buzz, buzz.js

readme

Buzz, a Javascript HTML5 Audio library

Build Status Built with Grunt

Buzz is a small but powerful Javascript library that allows you to easily take advantage of the new HTML5 audio element. It tries to degrade properly on non-modern browsers.

var mySound = new buzz.sound("/sounds/myfile", {
    formats: [ "ogg", "mp3", "aac" ]
});

mySound.play()
    .fadeIn()
    .loop()
    .bind("timeupdate", function () {
        document.querySelector("#timer").innerHTML = buzz.toTimer(this.getTime());
    });

Official website

http://buzz.jaysalvat.com/

Real life demo

http://buzz.jaysalvat.com/demo/

Documentation

http://buzz.jaysalvat.com/documentation/

Contributing

Please don't edit files in the dist subdirectory as it is generated via Grunt. You'll find source code in the src subdirectory! Regarding code style like indentation and whitespace, follow the conventions you see used in the source already.

PLEASE DO NOT use Gruntfile. I will. :)

License

The MIT License (MIT)

Copyright (c) 2014 Jay Salvat

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

changelog

Buzz, a Javascript HTML5 Audio library

CHANGE LOG

Buzz 1.2.0 2016-05-22

  • Add crossOrigin support to allow CORS
  • Fix a multiple FadeIn/FadeOut issue

Buzz 1.1.10 2015-04-20

  • Fix #93 readOnly networkState error

Buzz 1.1.9 2015-03-03

  • Don't create the AudioContext unless it is needed

Buzz 1.1.8 2015-01-12

  • Trigger sourceerror when sound file is not found

Buzz 1.1.7 2014-10-13

  • 'webAudiApi' option set to false by default. Switching to webAudioApi was a bad idea (numerous Firefox bugs)

Buzz 1.1.5 2014-09-10

  • Add 'webAudiApi:true' option to enable/disable webAudioApi routing

Buzz 1.1.4 2014-07-13

  • Improve UMD wrapper

Buzz 1.1.3 2014-07-11

  • Get component.json back

Buzz 1.1.2 2014-07-07

  • Remove component.json and add bower.json

Buzz 1.1.1 2014-06-25

  • Route through web audio API to improve performance if available
  • Qualify window.document because some environments (e.g. node-webkit)

Buzz 1.1.0 2013-08-15

  • Fix setTime infinite loop on Firefox
  • Fix a couple of method chaining bugs
  • Add AMD and CommonJS support
  • Add iframe support
  • Fix getPlayed method not returning good values
  • Add new architecture src / dist
  • Add minified version
  • Add Gruntfile

Buzz 1.0.6 2013-01-16

  • Fix the bindOnce bug
  • Fix the Stop/play bug
  • Fix the unbind bug
  • Replace delete by splice for removing a sound from a group
  • Remove group.setDuration method. This method didn't exist
  • It's now possible to write a class extending buzz.sound

Buzz 1.0.5 2011-12-17

  • Filtering unwanted properties to avoid weird sources in Firefox and IE
  • Fixed JShint warnings
  • In static function only access other static members in a static manner
  • Define local variables, so they do not become global
  • fix adding sounds to group

Buzz 1.0.4 2011-08-04

  • Add types
  • Fix the toTimer helper bug with 0
  • Fix array iteration for Mootools compatibility
  • Fix the ended propery bug
  • Fix some bugs where methods didn't degrade properly
  • Trigger method triggers real event

Buzz 1.0.3 2011-07-09

  • Set default volume to 80
  • Loop and unloop methods now return the instance object

Buzz 1.0.2 2011-07-04

  • Fade effects wait for the sound to be ready before to start
  • Loop and unloop methods now return the instance object

Buzz 1.0.1 2011-07-01

  • Fix arguments or array passed to Group constructor or methods
  • Fix the default volume effect

Buzz 1.0.0 2011-06-30

  • First public release