Play a sound sample with minim

edited February 2016 in Library Questions

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();

}
Tagged:

Answers

  • edited February 2016

    add an empty draw()

    void draw() {
          //
          image(img,10,10); 
    }
    
Sign In or Register to comment.