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

Re : Adding wav file

$
0
0
Nevermind..I figured it out :) 

Wav file works fine with this code: 

  1. import ddf.minim.*;
  2. Minim minim;
  3. AudioPlayer player;


  4. PImage img1,img2;

  5. void setup() {
  6.   size(640,480);
  7.   img1 = loadImage("splash.jpg");
  8.   minim = new Minim(this);
  9.   player = minim.loadFile("fuel.wav", 2048); //sound file
  10.   player.play();
  11. }

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

  23. void stop() {
  24.   player.close();
  25.   minim.stop();  
  26.   super.stop();
  27. }

Viewing all articles
Browse latest Browse all 1768

Trending Articles