Fix Audio Pipeline: EAX Decrypt, Decoder State Fix, Opus Optimization

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-15 21:35:23 +01:00
parent 338f6d4704
commit d6376d85a9
19 changed files with 182 additions and 25 deletions

View File

@@ -6,6 +6,8 @@ import (
"go-ts/pkg/protocol"
"go-ts/pkg/transport"
"gopkg.in/hraban/opus.v2"
)
type Channel struct {
@@ -24,6 +26,7 @@ type Client struct {
// Counters
PacketIDCounterC2S uint16
VoicePacketID uint16
// State
Connected bool
@@ -36,13 +39,19 @@ type Client struct {
// Server Data
Channels map[uint64]*Channel
// Audio
VoiceDecoders map[uint16]*opus.Decoder // Map VID (sender ID) to decoder
VoiceEncoder *opus.Encoder // Encoder for outgoing audio
}
func NewClient(nickname string) *Client {
return &Client{
Nickname: nickname,
PacketIDCounterC2S: 1,
VoicePacketID: 1,
Channels: make(map[uint64]*Channel),
VoiceDecoders: make(map[uint16]*opus.Decoder),
}
}