diff --git a/index.js b/index.js index 9607e5a..d326d7f 100644 --- a/index.js +++ b/index.js @@ -81,11 +81,14 @@ module.exports = function(audioContext, stream, opts) { function disconnect() { scriptProcessorNode.disconnect(); + analyser.disconnect(); + source.disconnect(); } function destroy() { captureTimeout && clearTimeout(captureTimeout); disconnect(); + scriptProcessorNode.onaudioprocess = null; } function monitor() { diff --git a/package.json b/package.json index fa651c3..c92f805 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "voice-activity-detection", - "version": "0.0.4", + "version": "0.0.5", "description": "Mic input activity detection", "main": "index.js", "license": "MIT",