Buzz is a small Javascript library that helps you to easily include and manage sounds in your websites using the HTML5 audio tag. It degrades silently on non-modern browsers.

Buzz is written by Jay Salvat and licensed under the MIT License.

Download Buzz! #version

Fork it on Github

Installation

npm (recommended)

npm install buzz

ES Module

import buzz from 'buzz'

CDN (UMD) for legacy browsers

<script src="https://cdnjs.com/libraries/buzz"></script>
What’s New in v2.0
  • Promise Support - All async methods now support both callbacks and Promises
  • Update JavaScript - ES6 syntax
  • Simplified Build - 2 files: buzz.js (ESM) + buzz.min.js (UMD)
  • TypeScript - Full type definitions included
  • Better Testing - Comprehensive headless tests
API Example
const sound = new buzz.sound('/sounds/sound', {
  formats: ['ogg', 'mp3', 'aac']
})

await sound.fadeIn()
sound.loop().bind('timeupdate', function () {
  const timer = buzz.toTimer(this.getTime())
  document.getElementById('timer').innerHTML = timer
})

// Traditional callback syntax (still supported)
sound.fadeIn(1000, function () {
  console.log('Fade in complete!')
})