This commit is contained in:
Amish Shah
2016-08-24 22:26:27 +01:00
parent 8683f45816
commit 253789f398
7 changed files with 26 additions and 9 deletions

View File

@@ -38,14 +38,18 @@ class VoiceConnectionPlayer extends EventEmitter {
if (streams) {
if (streams.inputStream && streams.pcmConverter) {
try {
if (streams.pcmConverter.stdin) {
streams.pcmConverter.stdin.end();
this.emit('debug', 'stream kill part 1/5 pass');
}
streams.pcmConverter.on('error', console.log);
streams.pcmConverter.stdin.on('error', console.log);
streams.pcmConverter.stdout.on('error', console.log);
streams.inputStream.stdout.on('error', console.log);
if (streams.pcmConverter.stdout.destroy) {
streams.pcmConverter.stdout.destroy();
this.emit('debug', 'stream kill part 2/5 pass');
}
if (streams.pcmConverter.stdin) {
streams.pcmConverter.stdin.end();
this.emit('debug', 'stream kill part 1/5 pass');
}
if (streams.pcmConverter && streams.pcmConverter.kill) {
streams.pcmConverter.kill('SIGINT');
this.emit('debug', 'stream kill part 3/5 pass');
@@ -59,7 +63,6 @@ class VoiceConnectionPlayer extends EventEmitter {
this.emit('debug', 'stream kill part 5/5 pass');
}
} catch (e) {
console.log(e);
return e;
}
}