func (vc *Connection) UpdateServer(server *ServerUpdate) error {
	vc.mu.Lock()
	defer vc.mu.Unlock()
	close(vc.stop)
	vc.wg.Wait()
	vc.speakingModeMu.Lock()
	vc.speakingMode = SpeakingModeOff
	vc.speakingModeMu.Unlock()
	vc.reset()
	ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
	defer cancel()
	return vc.connect(ctx, server)
}
UpdateServer updates the voice server this connection is using.
This closes the connection to the old server and establishes a new
connection to the updated server.
package voice
import (
	"context"
	"net"
	"sync"
	"time"
	"github.com/skwair/harmony/internal/payload"
	"github.com/skwair/harmony/log"
	"go.uber.org/atomic"
	"nhooyr.io/websocket"
)
var SilenceFrame = []byte{0xf8, 0xff, 0xfe}
type Connection struct {
	Send chan []byte
	Recv chan *AudioPacket
	mu sync.Mutex
	stateMu sync.RWMutex
	state   *State
	token string
	endpoint string
	dataEndpoint *net.UDPAddr
	connRMu sync.Mutex
	conn    *websocket.Conn
	udpConn *net.UDPConn
	speakingModeMu sync.Mutex
	speakingMode   SpeakingMode
	secret [32]byte
	ssrc uint32
	connected *atomic.Bool
	connecting *atomic.Bool
	reconnecting *atomic.Bool
	payloads chan *payload.Payload
	wg sync.WaitGroup
	error chan error
	reportErrorOnce sync.Once
	stop chan struct{}
	ctx    context.Context
	cancel context.CancelFunc
	lastHeartbeatAck, lastUDPHeartbeatAck   *atomic.Int64
	lastHeartbeatSent, lastUDPHeartbeatSent *atomic.Int64
	udpHeartbeatSequence *atomic.Uint64
	opusReadinessWG sync.WaitGroup
	logger log.Logger
}
func (vc *Connection) Logger() log.Logger {
	return vc.logger
}
func (vc *Connection) State() *State {
	vc.stateMu.RLock()
	defer vc.stateMu.RUnlock()
	return vc.state
}
func (vc *Connection) SetState(s *State) {
	vc.stateMu.Lock()
	defer vc.stateMu.Unlock()
	vc.state = s
}