audio

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecipientSender

type RecipientSender interface {
	SendAudio(sessionID uint32, packet []byte) error
}

RecipientSender sends an audio packet to a recipient.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router forwards voice packets to appropriate recipients.

func NewRouter

func NewRouter(sender RecipientSender, getChan func(uint32) uint32, getUsersInChan func(uint32) []uint32, getVoiceTarget func(uint32, uint8) []uint32) *Router

NewRouter creates an audio router.

func NewRouterWithConfig

func NewRouterWithConfig(cfg RouterConfig) *Router

NewRouterWithConfig creates an audio router with full configuration.

func (*Router) Route

func (r *Router) Route(senderSessionID uint32, voiceTarget uint8, decryptedPacket []byte) error

Route determines recipients and forwards the decrypted packet.

func (*Router) SetVoiceDebug

func (r *Router) SetVoiceDebug(enabled bool)

SetVoiceDebug updates the voice debug flag for runtime toggling.

type RouterConfig

type RouterConfig struct {
	Sender          RecipientSender
	GetChan         func(sessionID uint32) uint32
	GetUsersInChan  func(channelID uint32) []uint32
	GetVoiceTarget  func(sessionID uint32, targetID uint8) []uint32
	GetLinkedChans  func(channelID uint32) []uint32
	FilterRecipient func(senderSessionID, recipientSessionID uint32) bool
	CanSenderSpeak  func(senderSessionID uint32) bool
	VoiceDebug      bool
}

RouterConfig configures the audio router.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL