.cue() cannot be called very quickly in 2.2.2. It works as intended in 2.2.1, however. · Issue #40 · processing/processing-sound (original) (raw)
In order to sync each frame of an animation with a sound in the background, I had been using the following code in draw():
frameCue = frameCount/frmrate;
in.cue(frameCue);
in.play();
frmrate was set to 30 or 60, depending on my desired output framerate.
2.2.1 was able to call this successfully each time draw() was called, allowing me to save each frame as it was updated by the sound.
When I updated to 2.2.2, however, it seems as though .cue() would only work occasionally. Instead of a consistent choppiness (it's syncing 30 - 60 times a second, after all), I would see no response and hear no sound until the occasional blip. Another might follow a few seconds later. This seemed to happen at random, but did seem to be following along with the sound, though it was not able to consistently draw and play it audibly.
I noticed also that I could not call .cue() in setup() either. It would result in a silent and empty frame unless I also called .play() in draw(),
like so...
if (!in.isPlaying()) {
in.play();
}
...in spite of already having called it in setup(). Calling .cue() then .play() in setup worked perfectly well in 2.2.1, but would not work in 2.2.2 for some reason. .cue() could be called in draw(), but not every frame, like it was able to do in 2.2.1.
Honestly, I'm surprised this issue hasn't been brought up yet. It seems like that's some pretty basic .cue() functionality, right?
I tried reinstalling 2.2.2, restarting the computer, and reinstalling Processing (not necessarily in that order). No improvement. Once I reinstalled 2.2.1, everything worked as intended again.