processing library cassette

Java
import cassette.audiofiles.SoundFile;

SoundFile sound;

void setup()
{
  sound = new SoundFile(this, "sound.wav");
}

void draw()
{
  if(playSound)
  {
    sound.Play();
  }
}
Source

Also in Java: