From 564d31654f4ea7c89b0dc2b3c03fea95c171f984 Mon Sep 17 00:00:00 2001 From: Chinmay Pendharkar Date: Sat, 6 Aug 2016 21:22:28 +0800 Subject: [PATCH] Removes input when it's finished. Removes an input from the array of inputs when it's 'finished'. --- lib/mixer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mixer.js b/lib/mixer.js index 1572d58..26d5452 100644 --- a/lib/mixer.js +++ b/lib/mixer.js @@ -87,6 +87,10 @@ Mixer.prototype.input = function (args) { sampleRate: args.sampleRate || this.sampleRate }); this.inputs.push(input); + + input.on('finish', () =>{ + this.inputs.splice(this.inputs.indexOf(input), 1); + }); return input; };