We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, The code below is supposed to play the sample sound when the space button is pressed and have the loaded image up constantly but it won't do either! What am i doing wrong?
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
Minim minim;
AudioPlayer sou;
AudioSample beep;
PImage img;
void setup() {
size (displayWidth, displayHeight);
minim = new Minim(this);
sou = minim.loadFile("Beep.mp3");
sou.loop();
img=loadImage("Pointless.jpg");
background(255, 255, 255);
}
void keyPressed(){
if ((keyPressed==true)&(key==' '));
beep.trigger();
}
Answers
add an
emptydraw()