Fix Audio Pipeline: EAX Decrypt, Decoder State Fix, Opus Optimization
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user