mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
grunt default does weird things to lib
This commit is contained in:
@@ -126,4 +126,4 @@ var AudioEncoder = (function () {
|
||||
return AudioEncoder;
|
||||
})();
|
||||
|
||||
module.exports = AudioEncoder;
|
||||
module.exports = AudioEncoder;
|
||||
|
||||
@@ -19,4 +19,4 @@ var StreamIntent = (function (_EventEmitter) {
|
||||
return StreamIntent;
|
||||
})(EventEmitter);
|
||||
|
||||
module.exports = StreamIntent;
|
||||
module.exports = StreamIntent;
|
||||
|
||||
@@ -329,4 +329,4 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||
return VoiceConnection;
|
||||
})(EventEmitter);
|
||||
|
||||
module.exports = VoiceConnection;
|
||||
module.exports = VoiceConnection;
|
||||
|
||||
@@ -3,24 +3,24 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var VoicePacket = function VoicePacket(data, sequence, time, ssrc) {
|
||||
_classCallCheck(this, VoicePacket);
|
||||
_classCallCheck(this, VoicePacket);
|
||||
|
||||
var audioBuffer = data,
|
||||
returnBuffer = new Buffer(audioBuffer.length + 12);
|
||||
var audioBuffer = data,
|
||||
returnBuffer = new Buffer(audioBuffer.length + 12);
|
||||
|
||||
returnBuffer.fill(0);
|
||||
returnBuffer[0] = 0x80;
|
||||
returnBuffer[1] = 0x78;
|
||||
returnBuffer.fill(0);
|
||||
returnBuffer[0] = 0x80;
|
||||
returnBuffer[1] = 0x78;
|
||||
|
||||
returnBuffer.writeUIntBE(sequence, 2, 2);
|
||||
returnBuffer.writeUIntBE(time, 4, 4);
|
||||
returnBuffer.writeUIntBE(ssrc, 8, 4);
|
||||
returnBuffer.writeUIntBE(sequence, 2, 2);
|
||||
returnBuffer.writeUIntBE(time, 4, 4);
|
||||
returnBuffer.writeUIntBE(ssrc, 8, 4);
|
||||
|
||||
for (var i = 0; i < audioBuffer.length; i++) {
|
||||
returnBuffer[i + 12] = audioBuffer[i];
|
||||
}
|
||||
for (var i = 0; i < audioBuffer.length; i++) {
|
||||
returnBuffer[i + 12] = audioBuffer[i];
|
||||
}
|
||||
|
||||
return returnBuffer;
|
||||
return returnBuffer;
|
||||
};
|
||||
|
||||
module.exports = VoicePacket;
|
||||
module.exports = VoicePacket;
|
||||
|
||||
Reference in New Issue
Block a user