I've made a simple little game in Processing, but need some help. I have an mp3 and would like to add it to my app to run in a loop in the background.
Is this possible? Many thanks.
You can use a sound library. Processing already comes with Minim included. Have a look in File > Examples > Libraries > Minim Audio > LoadFile
import ddf.minim.*;
AudioPlayer player;
Minim minim;//audio context
void setup()
{
minim = new Minim(this);
player = minim.loadFile("file.mp3", 2048);
player.play();
}
void draw()
{
}
void stop()
{
player.close();
minim.stop();
super.stop();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With