Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Adding wav file

$
0
0
Hi,

I'm trying to add a .wav file to my application. Why can't I hear anything?

  1. import ddf.minim.*;
  2. Minim minim;

  3. PImage img1,img2;

  4. void setup() {
  5.   // Images must be in the "data" directory to load correctly
  6.   img1 = loadImage("splash.jpg");
  7.   size(640,480);
  8.   minim = new Minim(this);
  9.   minim.loadSample("fuel.wav"); //sound file
  10. }

  11. void draw() {
  12.   if(millis()<5000)
  13.   {
  14.   image(img1, 0, 0);
  15. }
  16. else{
  17.     img2 = loadImage("gamescreen.jpg");
  18.   image(img2,0,0);
  19.   //rest of code
  20. }
  21. }

  22. void stop() {
  23.   minim.stop();  
  24.   super.stop();
  25. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles