We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I am trying to generate a sound as part of a processing program.
I have tried the code below but it does not work.
I tried to store my sound file (Surf.wav) in a 'data' folder but still does not work.
I use 'filezilla' to load my sketch, so I have created the data folder below the 'public' folder.
I don't get any error message, just sound does not play.
Thanks for your help.
Vincent
code:
import ddf.minim.*;
Minim minim;
AudioPlayer player;
void setup() {
minim = new Minim(this);
player = minim.loadFile("data/Surf.wav");
player.play();
Answers
Try loadFile("Surf.wav"); Without the word "data" --- make sure file name is correct!!!
File name is case sensitive
Try make all vars global (they are already) and use play in draw()
Why is this posted under the p5js category? Sounds like you're trying to run Java Processing online (note for others: filezilla is an FTP client used to move files to a server); in which case you're out of luck... Online Java is dead 8-X
If you're trying to use the minim library with p5js you're also out of luck. You could instead use the p5js sound library...
Did not answer my question at all.
minim comes with a lot of examples, see processing, menu file, then examples (in your language), then minim | Basics
here the file is not in the data folder but just in the sketch folder
Thanks for this code Chrisir. Unfortunatly I copied it in a '.pde' file and then 'dragged' it on my internet site but it did not work. I don't understand why it does not work because I do the same thing with a game (written in processing language) and it works perfectly well (without any sound). In fact, my pde programme is integrated inside an html file with the following code:
Vincent
I don't know if a library (!) works in a website
ask gotoloop