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
1 changed files with 4 additions and 0 deletions

View File

@ -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;
};