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:
parent
15704c89fc
commit
2e56bb8881
4 changed files with 31 additions and 6 deletions
18
src/Parser/Packet/VoiceInit.ts
Normal file
18
src/Parser/Packet/VoiceInit.ts
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue