JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://buzz.jaysalvat.com/js/buzz.js"></script>
<div id="loopCount">0</div>

JavaScript

var loopCount = 0;
    var mySound = new buzz.sound("http://buzz.jaysalvat.com/demo/sounds/truck.mp3").bind('ended', function () {
        loopCount++;
        $('#loopCount').text(loopCount);
        this.play();
    }).play();