Skip to content

Commit

Permalink
SetOpusFrameProvider & SetOpusFrameReceiver should not be blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jul 2, 2023
1 parent 79b8080 commit 07e3134
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions voice/audio_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ type defaultAudioReceiver struct {
}

func (s *defaultAudioReceiver) Open() {
go s.open()
}

func (s *defaultAudioReceiver) open() {
defer s.logger.Debugf("closing audio receiver")
ctx, cancel := context.WithCancel(context.Background())
s.cancelFunc = cancel
Expand Down
4 changes: 4 additions & 0 deletions voice/audio_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ type defaultAudioSender struct {
}

func (s *defaultAudioSender) Open() {
go s.open()
}

func (s *defaultAudioSender) open() {
defer s.logger.Debug("closing audio sender")
lastFrameSent := time.Now().UnixMilli()
ctx, cancel := context.WithCancel(context.Background())
Expand Down

0 comments on commit 07e3134

Please sign in to comment.