sketchPath question
in
Programming Questions
•
1 year ago
Hello
I'm trying to populate an array of minim audioSnippets from the sketchPath but I'm having difficulty with the syntax, any help is greatly appreciated.
sourcefile = new String [numSamples];
int count = 0;
for (int i = 0; i < listOfFiles.length; i ++){
if (listOfFiles[i].isFile()){
if (listOfFiles[i].getName().endsWith(".mp3")){
sourcefile[count] = listOfFiles[i].getName();
count ++;
}
}
}
try{
for (count = 0; count < numSamples; count ++){
samples[count] = new AudioSnippet(minim, new sketchPath("") + "samples/" + sourcefile[count]);
}
}
catch (Exception e){
println("Exception while attempting to load sample!");
e.printStackTrace();
exit();
}
}
1