esonderegger / web-audio-peak-meter

Customizable peak meters, using the web audio API.
https://esonderegger.github.io/web-audio-peak-meter/
MIT License
125 stars 33 forks source link

Ability to disconnect from the source node #43

Closed evoyy closed 1 year ago

evoyy commented 1 year ago

I'm using the meter in a modal that can be opened and closed. When I close the modal I want to be able to disconnect it from my audio context to cleanup and not waste resources.

I know I can do this:

myMeter.node.disconnect()

It would be better to not have to access internal properties. Something like:

myMeter.disconnectSource()
esonderegger commented 1 year ago

Addressed in https://github.com/esonderegger/web-audio-peak-meter/pull/50

evoyy commented 1 year ago

Great solution - it works perfectly! Thanks!