Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

how to make a chirping noise every 5 minutes of the hour?

$
0
0

I used the minim sound library and I got a bird chirping noise to work. If I open my sketch at, for example, 8:34, and leave it open, at 8:35 the bird will chirp once then stop, which is great. that's what i want it to do. However, if I leave the sketch running, 5 minutes later, at 8:40, the bird will no longer chirp. It only seems to work once and I'm not sure why. Although you can't access my sound file, here is the code I used. if((int)minute == 0) {player.play(); } if((int)minute == 5) {player.play();} if((int)minute == 10) {player.play();} if((int)minute == 15) {player.play();} if((int)minute == 20) {player.play();} if((int)minute == 25) {player.play(); } if((int)minute == 30) {player.play(); } if((int)minute == 35) {player.play();} if((int)minute == 40) {player.play(); } if((int)minute == 45) {player.play(); } if((int)minute == 50) {player.play();} if((int)minute == 55) {player.play(); }

Why does it only work one time the sketch is open but not after that? How can I fix this?

Thanks in advance :)

}


Viewing all articles
Browse latest Browse all 2896

Trending Articles