Looping Audio

edited October 2013 in Library Questions

I'm working on a game with Processing (it's a platformer, kind of a hobby project of mine) and I'm working on the music and sound right now. I've done a basic search and gotten a lot of very specific questions on this forum but no real general answers. I have gotten minim to play a .wav file once though, and then it stops.

[EDIT]: I got the loop() to work fine. docs are in fact found here. http://code.compartmental.net/tools/minim/ I will leave this topic up, however, since I'm somewhat curious.

My main question is, what would be the a good, logical method of adding looping music to the game? Is minim good for this, or do any of you prefer another library?

P.S. I'm not posting my code because I wanted to get a better idea of how to set up sound first. It's not buggy, I just don't know too much about audio yet.

Answers

  • Answer ✓

    You can declare a Boolean variable and then loop with that for instance

    boolean isRepeating; isRepeating =false; AudioPlayer player ;

    if(isRepeating == true) { if(player.isPlaying()==false) { player.rewind(); player.play(); }

    mousePressed() { isRepeating =true; }

    //i hope you get it,its not well organised this is just the idea

  • Answer ✓

    or you can use player.loop()

Sign In or Register to comment.