Hi,
I am working on a tangible music player with Arduino and for this I am using the minim library. However, the player.pause() function does not work in my code. It only stops the song for a few milliseconds and then continues to play the song.
The code for the pause function is as the following:
boolean state = false;
if (keyPressed) {
if (key == 'p' && !state) {
state = true;
player[currentSong].pause();
}
else if (key == 'p' && state) {
state = false;
player[currentSong].play();
}
Is there something else that I have to add in order to let it pause until I press the P key again?