Pause playback while transmitting and declare microphone use.
macOS refuses capture without a usage string, and queued remote audio was still handed to the speaker after push-to-talk began. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -151,6 +151,7 @@ func (s *Station) WriteMicrophone(pcm []int16) {
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
// A lost datagram ends the session when the receive timer expires.
|
||||
_ = s.sendUDP(udpAudio, appendBlob(nil, pkt))
|
||||
}
|
||||
}
|
||||
@@ -159,6 +160,10 @@ func (s *Station) WriteMicrophone(pcm []int16) {
|
||||
func (s *Station) TakePlayback() []int16 {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.transmitting() {
|
||||
s.play = nil
|
||||
return nil
|
||||
}
|
||||
out := s.play
|
||||
s.play = nil
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user