Skip to content

Instantly share code, notes, and snippets.

@jens-a-e
Last active May 24, 2016 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jens-a-e/7742890a278794e100a75aadc161986d to your computer and use it in GitHub Desktop.
Save jens-a-e/7742890a278794e100a75aadc161986d to your computer and use it in GitHub Desktop.
// Download the sound library here: https://github.com/processing/processing-sound/releases
import processing.sound.*;
SoundFile file;
void setup() {
file = new SoundFile(this, "volkstheater.aiff");
file.loop();
}
void draw() {
}
void keyPressed() {
if (key == ' ') {
file.play();
}
}
void keyReleased() {
if (key == ' ') {
file.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment