I am using the addCue method on a p5.soundFile. I invoke this method in the setup function. The callback function i provide is called multiple times (around 170) instead of just 1 time (which I expected). Does anyone know more about this? I know I can add a check myself so the critical part of the callback only runs once, but this seems a bit tedious.
I think you have to share some code with us; it’s hard to see what’s going on without it. But, could it be that you’re looping the sound so that the cue point is reached more than once? From the addCue() documentation:
Schedule events to trigger every time a MediaElement (audio/video) reaches a playback cue point.
Funny, looks like you stumbled over a bug that was actually fixed just a couple of days ago. So you can look forward to this issue disappearing in a future release of the library.