Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Play a sound sample with minim

$
0
0

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

}

Viewing all articles
Browse latest Browse all 2896

Trending Articles