@panvari wrote:
Hi, I’m fairly new to openFrameworks, and I’m having an issue with playing different sounds in my program. I have three different sounds I want to play when different triggers are activated. I have set up a variable called ‘musicNum’ that initializes at 0 and increments when certain events happen.
if (musicNum == 0) { bgMusic[0].play(); bgMusic[1].stop(); bgMusic[2].stop(); } else if (musicNum == 1) { bgMusic[1].play(); bgMusic[0].stop(); bgMusic[2].stop(); } else if (musicNum == 2) { bgMusic[2].play(); bgMusic[0].stop(); bgMusic[1].stop(); }
This is my code that I have been trying. Right now, the when musicNum is equal to 0 the first song plays, but then when musicNum is equal to one, the first song stops, but the second song does not play.
If anyone has any suggestions please let me know!
Posts: 1
Participants: 1