const Troubadour = require('troubadour');
const troubadourLoop1 = new Troubadour('mplayer'); //or pass in sox for example
const troubadourLoop2 = new Troubadour('mplayer'); //or pass in sox for example

function loop1(file){
    troubadourLoop1.on('start', () => {
      // Do something here when the audio starts playing
    });

    troubadourLoop1.on('end', () => {
      // Do something here when the audio finishes playing
      troubadourLoop1.play(file);
    });

  troubadourLoop1.play(file);
}

function loop2(file){
    troubadourLoop2.on('start', () => {
      // Do something here when the audio starts playing
    });

    troubadourLoop2.on('end', () => {
      // Do something here when the audio finishes playing
      troubadourLoop2.play(file);
    });

  troubadourLoop2.play(file);
}

loop1('../assets/snd/chew.mp3');
loop2('../assets/snd/small-33.mp3');
