From 7cc7b09957ad54c8274e8153a296938967777dc6 Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Tue, 26 Jan 2016 21:42:37 -0600 Subject: [PATCH] Moved Voice.Ready = true into opusSender --- voice.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/voice.go b/voice.go index db343aa..3a1df9e 100644 --- a/voice.go +++ b/voice.go @@ -355,7 +355,6 @@ func (v *Voice) udpOpen() (err error) { go v.udpKeepAlive(5 * time.Second) // TODO: find a way to check that it fired off okay - v.Ready = true return } @@ -399,6 +398,10 @@ func (v *Voice) opusSender(opus <-chan []byte, rate, size int) { runtime.LockOSThread() + // Voice is now ready to receive audio packets + // TODO: this needs reviewed as I think there must be a better way. + v.Ready = true + var sequence uint16 = 0 var timestamp uint32 = 0 udpHeader := make([]byte, 12)