Removes input when it's finished.

Removes an input from the array of inputs when it's 'finished'.
This commit is contained in:
Chinmay Pendharkar 2016-08-06 21:22:28 +08:00 committed by GitHub
parent 528317ccbc
commit 564d31654f

View File

@ -87,6 +87,10 @@ Mixer.prototype.input = function (args) {
sampleRate: args.sampleRate || this.sampleRate sampleRate: args.sampleRate || this.sampleRate
}); });
this.inputs.push(input); this.inputs.push(input);
input.on('finish', () =>{
this.inputs.splice(this.inputs.indexOf(input), 1);
});
return input; return input;
}; };