Simplify check in StreamDispatcher and add test voice bot

This commit is contained in:
Amish Shah
2016-12-29 16:10:51 +00:00
parent 1452fa5014
commit 4541b3e264
2 changed files with 62 additions and 1 deletions

View File

@@ -215,7 +215,7 @@ class StreamDispatcher extends EventEmitter {
buffer = this.applyVolume(buffer);
data.count++;
data.sequence = (data.sequence + 1) < 65536 ? data.sequence + 1 : 0;
data.sequence = data.sequence < 65535 ? data.sequence + 1 : 0;
data.timestamp = data.timestamp + 4294967295 ? data.timestamp + 960 : 0;
this.sendBuffer(buffer, data.sequence, data.timestamp);
@@ -231,6 +231,7 @@ class StreamDispatcher extends EventEmitter {
this.destroyed = true;
this.setSpeaking(false);
this.emit(type, reason);
if (type !== 'end') this.emit('end', `destroyed due to ${type} - ${reason}`);
}
startStreaming() {