mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
add encoder for voiceInit
This commit is contained in:
parent
ae79b6a0d4
commit
7f2d702ab0
3 changed files with 39 additions and 4 deletions
25
src/tests/unit/Parser/Packet/VoiceInitTest.ts
Normal file
25
src/tests/unit/Parser/Packet/VoiceInitTest.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import {BitStream} from 'bit-buffer';
|
||||
import {assertEncoder, assertParser, getStream} from './PacketTest';
|
||||
import {EncodeVoiceInit, ParseVoiceInit} from '../../../../Parser/Packet/VoiceInit';
|
||||
|
||||
const data = [118, 97, 117, 100, 105, 111, 95, 99, 101, 108, 116, 0, 255, 34, 86];
|
||||
|
||||
suite('VoiceInit', () => {
|
||||
test('Parse voiceInit', () => {
|
||||
assertParser(ParseVoiceInit, getStream(data), {
|
||||
packetType: 'voiceInit',
|
||||
codec: 'vaudio_celt',
|
||||
quality: 255,
|
||||
extraData: 22050
|
||||
}, 120);
|
||||
});
|
||||
|
||||
test('Encode voiceInit', () => {
|
||||
assertEncoder(ParseVoiceInit, EncodeVoiceInit, {
|
||||
packetType: 'voiceInit',
|
||||
codec: 'vaudio_celt',
|
||||
quality: 255,
|
||||
extraData: 22050
|
||||
}, 120);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue