I'm trying to integrate the file-uploader-service Filepicker.io into a processing.js sketch I already made. It is fully functional locally, where you could choose a audio source from your computer and it does magic things with this audio. Now I'd like to let the user choose a file locally (no uploads) and process the same online, but I can't get it to work to read the file (I can get the api-key of the file)
My index.html
<!DOCTYPE html>
<html>
<head>
<script src="processing-1.4.1.min.js"></script>
<script type="text/javascript" src="//api.filepicker.io/v1/filepicker.js"></script>
</head>
<body>
<input type="filepicker" data-fp-apikey="*******"
data-fp-mimetypes="audio/wav, audio/mpeg" data-fp-container="modal"
data-fp-services="BOX,COMPUTER,DROPBOX"
onchange="alert(event.fpfile.url)">
<canvas data-processing-sources="minimFFT_test.pde Freqdot.pde Spec.pde"></canvas>
</body>
</html>
and my minimFFT_test.pde
, note the minim.loadFile()
(javadoc) method below:
import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
AudioPlayer song;
void setup() {
size(960, 1000);
minim = new Minim(this);
//***it should read here the path to the selected file***
song = minim.loadFile(PATHTOFILE);
song.loop();
}