Drag and drop sound file and play it?

Hello,

I am trying to create an audio visualizer and I need to have drag and drop functionality in my program. I've watched Daniel Shiffman's tutorial on drag and drop but I can't seem to figure out how to turn the file.data into a p5.SoundFile.

Thanks!

function newSong (file) {

button.class('btn btn-warning'); button.html("Play");

if (file.type != "audio") { showAlert("danger","Invalid File Type! Supported formats are mp3 and m4a.");

} else { showAlert("info","Loading sound file " + file.name + ". Please wait."); song.pause(); button.addClass("disabled"); playAllowed = false; song = file.data;

} }

Sign In or Register to comment.