change error emission logic

This commit is contained in:
Amish Shah
2016-12-29 14:14:27 +00:00
parent e1d01ed6a2
commit 627a8870f5

View File

@@ -61,7 +61,7 @@ class AudioPlayer extends EventEmitter {
transcoder.on('error', e => {
this.destroyStream(stream);
if (this.listenerCount('error') > 0) this.emit('error', e);
else this.emit('warn', e);
this.emit('warn', `prism transcoder error - ${e}`);
});
return this.playPCMStream(transcoder.output, options);
}