I’m trying to make a random generator of mp3 files on Processing but I don’t know how to do it.
I’ve tried to create a class (and before I tried it with an Array) with my audio files but I can’t get it to run.
import processing.sound.*;
processing_merci.Merci.files;
SoundFile file;
ArrayList sound_merci = new ArrayList();
void setup() {
size (800, 800);
background(255);
file.play();
}
void draw() {
}
and here’s my class:
import processing.sound.*;
class Merci {
// définir les attributs
SoundFile files;
ArrayList files = new ArrayList();
Merci (){
files = new SoundFile(this, “merci_Victor.mp3”);
file = new SoundFile(this, “merci_Ayten.mp3”);
file = new SoundFile(this, “merci_JulieT.mp3”);
file = new SoundFile(this, “merci_Lenard.mp3”);
file = new SoundFile(this, “merci_Lisa.mp3”);
file = new SoundFile(this, “merci_Noé.mp3”);
file = new SoundFile(this, “merci_Pierre.mp3”);
file = new SoundFile(this, “merci_Rita.mp3”);
file = new SoundFile(this, “merci_Prune.mp3”);
file = new SoundFile(this, “merci_Sarah.mp3”);
file = new SoundFile(this, “merci_Thomas.mp3”);
file = new SoundFile(this, “merci_Vlad.mp3”);
}
}