bool gb.sound.isPlaying( int8_t trackIdentifier )
gb.sound.isPlaying returns true if the track identifier is playing
bool: true if the track is playing, otherwise false
#include <Gamebuino-Meta.h>
void setup() {
gb.begin();
}
int8_t track = -1;
void loop() {
while(!gb.update());
gb.display.clear();
// check if the track is playing
if (gb.sound.isPlaying(track)) {
gb.display.println("Playing");
}
if (gb.buttons.pressed(BUTTON_A)) {
track = gb.sound.playOK();
}
}