1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 09:04:13 +02:00

parse updated voice init

This commit is contained in:
Robin Appelman 2017-02-15 16:12:54 +01:00
commit 2e56bb8881
4 changed files with 31 additions and 6 deletions

View file

@ -0,0 +1,18 @@
import {VoiceInitPacket} from "../../Data/Packet";
import {BitStream} from 'bit-buffer';
export function VoiceInit(stream: BitStream): VoiceInitPacket {
//ParserGenerator.make('voiceInit', 'codec{s}quality{8}'),
const codec = stream.readASCIIString();
const quality = stream.readUint8();
if (codec === 'vaudio_celt') {
// no clue, from 2017-2-14 update
stream.readUint8();
stream.readUint8();
}
return {
packetType: 'voiceInit',
codec: codec,
quality: quality
}
}