diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-11-06 18:37:11 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-11-06 18:37:11 +0300 |
| commit | 2f8c92f261586f68a976efce0cfcdd0401f402e0 (patch) | |
| tree | 33189cc48987789dff4e7fba0a74d2b2326f0a04 /pkg/messages/types/svcVoiceInit.go | |
| parent | convert cm ticks correctly (diff) | |
| download | sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.tar.gz sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.tar.bz2 sdp.go-2f8c92f261586f68a976efce0cfcdd0401f402e0.zip | |
dont try to understand it, feel itlp-parser
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 | } | ||