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:
Konrad Neitzel
2026-10-03 16:32:01 +02:00
co-authored by Cursor
parent 9c4f6621fc
commit 6233292931
9 changed files with 44 additions and 15 deletions
+5
View File
@@ -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