playback

by Wangshu Sun

HTML

<script src="https://tonejs.github.io/CDN/r6/Tone.js"></script>
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>

JavaScript

var sampleURL = "http://scarlettsan.me/resources/Dream_high.mp3";
var sampleURL2 = "http://scarlettsan.me/resources/Dream_high_76.mp3";
var sampleURL3 = "http://scarlettsan.me/resources/Dream_low.mp3";

var player = new Tone.Player(sampleURL).toMaster();
var player2 = new Tone.Player(sampleURL2).toMaster();
var player3 = new Tone.Player(sampleURL3).toMaster();

//trigger the start of the sample once its loaded
Tone.Buffer.on("load", function(){
	player.loop = true;
  player2.loop = true;
  player3.loop = true;
  player.start();
  player2.start();
  //player3.start();
});