Is there a way to remove an AudioContext
after I've created it?
var analyzers = []; var contexts = []; try { for(var i = 0; i<20; i++) { contexts[i] = new AudioContext(); analyzers[i] = contexts[i].createAnalyser(); } }catch(e) { console.log(e); // too many contexts created -- how do I remove them? }
I've tried this, but it doesn't let me create new contexts after the fact: analyzers.forEach(function(analyzer){analyzer.disconnect(analyzer.context.destination)})
I am using Chrome 36 on Ubuntu Linux 14.04.
AudioContext.close() will release the hardware of the context, but check that it is available only for recent versions of chrome and firefox. Not available for IE aparently. Check the documentation: https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/close
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With