import ddf.minim.*;
PImage img;
Minim minim;
AudioPlayer player;
void setup()
{
size(512, 500, P3D);
img = loadImage("1.jpg");//布魯克桌布
img.resize(512,500);//設定大小
minim = new Minim(this);
player = minim.loadFile("laugh.mp3");
//player.play();
}
void mousePressed(){
player.rewind();
player.play();
}
void draw ()//需到這行不然無法撥放
{
background(img);//放上桌布
}

沒有留言:
張貼留言