Commit 56fd90a
feat(voice V5): turn-taking + barge-in + .record(STT)<->.playback(TTS) session handoff
The integration-risk piece. STT forces the shared AVAudioSession to .record; TTS needs .playback.
Handled by MUTUAL OVERRIDE — each side stops the other and re-asserts its own category before its
operation, so they never fight or deadlock:
- startVoiceInput() stops TTS first (trinityVoice.stop()) → SpeechTranscriber sets .record+active.
This is also BARGE-IN: tapping the mic while Trinity speaks cuts the reply and starts listening,
and the mic never captures Trinity's own voice.
- speakIfEnabled() stops STT first (if isListening) → TrinityVoice.speak() now re-asserts .playback
via configureAudioSession() before speaking, flipping the session back from .record.
isSpeaking is published for UI. The shared stop()/CarPlay path is untouched (the re-assert lives in
speak()). Money-isolated: 0 signing calls. App build green. Held. DEVICE-TEST gate applies — session
transitions (mic-after-TTS, TTS-after-mic, barge-in) only fully verify on a real device.1 parent 80e292c commit 56fd90a
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| |||
110 | 115 | | |
111 | 116 | | |
112 | 117 | | |
113 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
| |||
0 commit comments