diff options
Diffstat (limited to 'pkg/messages/types/svcVoiceInit.go')
| -rw-r--r-- | pkg/messages/types/svcVoiceInit.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/pkg/messages/types/svcVoiceInit.go b/pkg/messages/types/svcVoiceInit.go deleted file mode 100644 index eb6093f..0000000 --- a/pkg/messages/types/svcVoiceInit.go +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | package messages | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "github.com/pektezol/bitreader" | ||
| 5 | ) | ||
| 6 | |||
| 7 | type SvcVoiceInit struct { | ||
| 8 | Codec string | ||
| 9 | Quality uint8 | ||
| 10 | SampleRate int32 | ||
| 11 | } | ||
| 12 | |||
| 13 | func ParseSvcVoiceInit(reader *bitreader.Reader) SvcVoiceInit { | ||
| 14 | svcVoiceInit := SvcVoiceInit{ | ||
| 15 | Codec: reader.TryReadString(), | ||
| 16 | Quality: reader.TryReadUInt8(), | ||
| 17 | } | ||
| 18 | if svcVoiceInit.Quality == 0b11111111 { | ||
| 19 | svcVoiceInit.SampleRate = reader.TryReadSInt32() | ||
| 20 | } else { | ||
| 21 | if svcVoiceInit.Codec == "vaudio_celt" { | ||
| 22 | svcVoiceInit.SampleRate = 22050 | ||
| 23 | } else { | ||
| 24 | svcVoiceInit.SampleRate = 11025 | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | return svcVoiceInit | ||
| 29 | } | ||