aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcVoiceInit.go
blob: 4c95aab0a4c02cb78d6ff2945bb599f8f692589c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package messages

import "github.com/pektezol/bitreader"

type SvcVoiceInit struct {
	Codec   string
	Quality uint8
	Unk     float32
}

func ParseSvcVoiceInit(reader *bitreader.ReaderType) SvcVoiceInit {
	svcVoiceInit := SvcVoiceInit{
		Codec:   reader.TryReadString(),
		Quality: uint8(reader.TryReadBits(8)),
	}
	if svcVoiceInit.Quality == 0b11111111 {
		svcVoiceInit.Unk = reader.TryReadFloat32()
	}
	return svcVoiceInit
}