processing / processing-sound

Audio library for Processing built with JSyn
https://processing.org/reference/libraries/sound/
GNU Lesser General Public License v2.1
149 stars 50 forks source link

Repeating same sound eventually starts to fail. #17

Closed RichardEll closed 1 year ago

RichardEll commented 6 years ago

If you load a sound from disk and then repeatedly call the play method at short ( < 0.25 second ) intervals, without waiting for the previous sound to complete, then it eventually starts to distort and become "scratchy". Even waiting a few seconds before replaying the sound does not solve the problem. I am using a Windows 7 computer.

mekb-turtle commented 5 years ago

Have you tried adding a second silence at the end of the audio file, also make sure to call sound.stop() before you call sound.play(), so no more than one sound is playing at once, so no feedback can occur, also make sure that the audio file is signed frequency.

jwarmouth commented 1 year ago

I'm having this same issue. It looks like Kevin made a recent commit. Is there a way that I can download/pull this recent commit and compile it as a Processing library?

kevinstadler commented 1 year ago

@jwarmouth indeed, a much improved new library release is in the making! I have just packaged up a test build of the new release, you can download the sound.zip from here and just extract it to your Processing libraries folder (replacing the existing sound folder): https://github.com/processing/processing-sound/releases/tag/v2.4.0-preview

We are also looking for feedback on the new release before we push it to the wider public, so if you could let us know whether this version fixes your issue, or if there is anything else that you notice/run into regarding the new library we would be super grateful.

jwarmouth commented 1 year ago

@jwarmouth indeed, a much improved new library release is in the making! I have just packaged up a test build of the new release, you can download the sound.zip from here and just extract it to your Processing libraries folder (replacing the existing sound folder): https://github.com/processing/processing-sound/releases/tag/v2.4.0-preview

We are also looking for feedback on the new release before we push it to the wider public, so if you could let us know whether this version fixes your issue, or if there is anything else that you notice/run into regarding the new library we would be super grateful.

Thank you! I installed the test build, and it definitely seems to fix the issue. I am happy to be able to create the functionality I need with the native Sound library, rather than having to work with Beads, Minim, or another 3rd party library.