WaveSurfer stops working after several destroy() calls #3813
Replies: 2 comments 6 replies
-
This is most likely a Web Audio memory leak. You can use Chrome's devtools (the Memory tab) to see where the decoded buffer is trapped. I doubt it's a JS leak, but briefly checking the code, I see that |
Beta Was this translation helpful? Give feedback.
-
I replicated the issue on an HTML+JS only project based on the official example for the RecordPlugin. Same problem as before, after recording several times on mobile browser the recorded audio won't play and waves stop working: https://stackblitz.com/edit/vitejs-vite-uzxtct?file=main.js |
Beta Was this translation helpful? Give feedback.
-
Issue
I'm facing performance issues when using wavesurfer.js with the RecordPlugin in my application based in Ionic/Angular when run on Android.
I'm dynamically creating and destroying multiple WaveSurfer instances over the same container to handle different audio files generated by the RecordPlugin. Each time I finish a recording, the component is destroyed and tested that ngOnDestroy is triggered. However, after creating and destroying several instances I've noticed a significant performance degradation, and after the 10th created instance WaveSurfer stops working.
Reproduce the issue
A simplified Angular-based project demonstrating the issue is available at https://stackblitz.com/edit/stackblitz-starters-8ijgtr?file=src%2Fapp%2Fwave%2Fwave.component.ts. To reproduce the error, follow these steps on a mobile browser, Android preferred:
Repeat this sequence approximately 10 times. The Wavesurfer instance should fail to function after the tenth iteration.
Potential Causes
I'm seeking guidance on:
Additional Information
I can provide more detailed code snippets and information if its needed.
Beta Was this translation helpful? Give feedback.
All reactions