p5.js sound: Playing back files in sync

Hi

I have a p5js sketch, where I want to play back four individual mp3 tracks in sync. I can get them to play, but they are of in terms of sync when I run the sketch. I know that the files themselves are in perfect sync.

Here is my code so far.

var bass, drums, guitar, vox;

function preload() {

bass = loadSound('data/bass.mp3');
drums = loadSound('data/drums.mp3');
guitar = loadSound('data/guitar.mp3');
vox = loadSound('data/vox.mp3');

}

function setup() {
createCanvas(1350, 1045);

bass.play();
drums.play();
guitar.play();
vox.play();
}

function draw() {

}

Any ideas?

Answers

Sign In or Register to comment.