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.
npm (recommended)
npm install buzz
ES Module
import buzz from 'buzz'CDN (UMD) for legacy browsers
<script src="https://cdnjs.com/libraries/buzz"></script>buzz.js (ESM) + buzz.min.js (UMD)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!'); });