Closed liJie-wk closed 2 years ago
Unfortunately Tone.js does not attempt to support browsers that are more than 2 versions old. Browser compatibility, especially how it interacts with the Web Audio API is too complex to try and support every version of every browser. I hope you understand
Unfortunately Tone.js does not attempt to support browsers that are more than 2 versions old. Browser compatibility, especially how it interacts with the Web Audio API is too complex to try and support every version of every browser. I hope you understand
Okay, thanks for the answer
Hi @liJie-wk, I do remember that the test suite of standardized-audio-context used to crash on older versions of Safari. The test suite consists of about 10000 tests which cause a lot of memory pressure. The crash implied that there was probably a memory leak somewhere. I never found out if the memory leak was in the codebase of standardized-audio-context or in Safari itself. The crashes didn't happen in other browsers but since Safari had and has by far the worst implementation of the Web Audio API it also was executing a lot of workarounds that didn't run in any other browser. So it's also possible that any of these workarounds caused the crash.
I think one thing you could try is to close()
the existing AudioContext
from time to time to replace it with a new one. Maybe this helps to trigger the garbage collection. It's just a guess. I'm not sure if it's actually going to help.
As Yotam already said it's all very complex.
Hi @liJie-wk, I do remember that the test suite of standardized-audio-context used to crash on older versions of Safari. The test suite consists of about 10000 tests which cause a lot of memory pressure. The crash implied that there was probably a memory leak somewhere. I never found out if the memory leak was in the codebase of standardized-audio-context or in Safari itself. The crashes didn't happen in other browsers but since Safari had and has by far the worst implementation of the Web Audio API it also was executing a lot of workarounds that didn't run in any other browser. So it's also possible that any of these workarounds caused the crash.
I think one thing you could try is to
close()
the existingAudioContext
from time to time to replace it with a new one. Maybe this helps to trigger the garbage collection. It's just a guess. I'm not sure if it's actually going to help.As Yotam already said it's all very complex.
Okay, I get it, thank you very much!
Hello authors, Tone .js is amazing! I successfully used it to make a drum machine and it worked very well. But I found that:
It plays midi in a loop on iOS13.4 or 13.6, and a strange rhythm will appear after 4 to 5 minutes, but it does not occur on ios14.x and ios15.x, do you have any good solutions? Here's part of my code
The same ios13.4 or 13.6, every time I switch midi and soundfont, I will first distribute and dispose, and then recreate. I found that frequent switching will cause memory leaks, which do not occur on iOS14.x and ios15.x, for which I improved the code to reduce the number of destroy creations, but I know that there is still a possibility of memory leaks