You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stutter and lag when playing multiple samples repeatedly #74
Thanks for reporting! Presumably this is an issue with how extra JSyn data players are allocated ad hoc when a sound file that is already playing is cued to start another playback... This will require a bit of debugging around here to figure out whether the issue is with the JSyn engine being overloaded, or if it's a general garbage collection issue (in which case this TODO finally needs implementing...):
I had another look and it might not be just about the number of active audio players, but an issue of previously used but now inactive players staying connected to the synthesis engine forever. Could you do me a favour and try out the following test build and let me know if it improves the situation for you? sound.zip Just extract it into your Processing's libraries/ folder, replacing the sound directory that is already there.
I tried to test it with the sketch you posted above but I'm finding it difficult to hear past the clipping that's happening with too many simultaneous players, you probably have a better idea of what it should sound like...
(note that audiosample.loop() is probably not working in this build, all one-shot methods like .play(), .jump() etc should work as expected though)
Hi,
I just tested the provided lib build, and the behavior seems unchanged. Once the number of repeatedly played sounds exceeds the threshold, it will start to stutter even after the playback has finished.
Activity
kevinstadler commentedon Oct 24, 2022
Thanks for reporting! Presumably this is an issue with how extra JSyn data players are allocated ad hoc when a sound file that is already playing is cued to start another playback... This will require a bit of debugging around here to figure out whether the issue is with the JSyn engine being overloaded, or if it's a general garbage collection issue (in which case this TODO finally needs implementing...):
processing-sound/src/processing/sound/AudioSample.java
Lines 305 to 320 in d508007
trackme518 commentedon Nov 26, 2022
Hi,
is it maybe possible to get number of used audio players at given time? So at least I could monitor it and restrict the max number....
kevinstadler commentedon Nov 27, 2022
I had another look and it might not be just about the number of active audio players, but an issue of previously used but now inactive players staying connected to the synthesis engine forever. Could you do me a favour and try out the following test build and let me know if it improves the situation for you? sound.zip Just extract it into your Processing's
libraries/folder, replacing thesounddirectory that is already there.I tried to test it with the sketch you posted above but I'm finding it difficult to hear past the clipping that's happening with too many simultaneous players, you probably have a better idea of what it should sound like...
(note that
audiosample.loop()is probably not working in this build, all one-shot methods like.play(),.jump()etc should work as expected though)trackme518 commentedon Nov 28, 2022
Disconnect all parts of stopped output units individually.
Disconnect all parts of stopped output units individually.