Skip to content

feat: the voice pauses on its own while another app uses the mic - #440

Merged
znat merged 3 commits into
feature/voice-pausefrom
voice-pause/5-calls
Nov 10, 2026
Merged

znat merged 3 commits into
feature/voice-pausefrom
voice-pause/5-calls

Conversation

@znat

@znat znat commented Nov 10, 2026

Copy link
Copy Markdown
Owner

When another app keeps the mic open for 2 seconds, as Zoom, Teams, FaceTime or a call in the browser do, the voice holds its answers. The pill says "Voice paused · Zoom is using the mic" with Resume. When the call ends with answers waiting, the voice stays paused and the pill says "Call over · 3 waiting" with Resume and Not now. voice.pause_during_calls, on by default, turns it off.

PR 5 of the voice-pause train. Base: feature/voice-pause.

How it decides
  • CallWatch reads Core Audio's process objects: kAudioHardwarePropertyProcessObjectList, then PID, IsRunningInput and BundleID per object.
  • It uses property listeners, not a poll. IsRunningInput sends no notice when it changes. A process's Devices property does, on start and on stop. So it listens to every property of each process object, plus the list, and reads the list again after any notice. Measured here: notices come within 0.2 s of the mic opening or closing. A full read costs about 60 ms, which is why a 1 s poll was not used.
  • CallState is a pure state machine: idle, rising, on, falling. The mic must stay open 2 s before "call started" and closed 5 s before "call over".
  • ParrotFlow's own pid does not count, and neither does any com.parrotflow.* bundle, so a dictation in the other build is not a call.
  • The name is the first ancestor process with a Dock icon: Chrome and Teams take the mic in a helper. WebKit's GPU process is named from its own "… Graphics and Media" name. avconferenced is named FaceTime.
How it holds
  • A new VoiceQueue.Hold.call. The playing answer goes back to the front at its sentence, as for the other holds.
  • Resume during the call releases the hold. That call does not hold the voice again.
  • Call over with answers waiting becomes a plain .user pause until resumed, so there is one pause to resume. With nothing waiting, the hold just goes.
  • A pause of your own from before the call is left as it was.
  • The pill shows a call only while answers wait, so an idle voice puts nothing on screen during a call.
  • The menu says "Paused · Zoom is using the mic" and Resume; ⌃⌥P resumes too. The menu bar count now comes from the queue, so Not now keeps it.
  • The menu checkbox from the design is not in this PR. The only menu writer is the microphone list's text splicer; a bool needs its own.
Checks
  • scripts/check-claude-voice.sh: 417/417 cases, 22/22 script checks. New: 9 calls cases, 2 queue, 5 pill, 2 menu, 2 check-config.
  • Deliberate break: rise 2 → 1 s and the ParrotFlow filter off failed 3 cases (410/413), then restored.
  • CallWatch against real Core Audio, with a scratch process that opened the mic 4 s, closed it 8 s, then opened it 1 s: started 2.1 s after it opened, over 5.1 s after it closed, nothing for the 1 s blip.
  • swift build -c release: no new warnings. swiftlint lint --quiet: 72 findings before and after.
  • PARROTFLOW_CONFIG_DIR=$(mktemp -d) make test: "Every check passed."
  • --panel-sheet: the three new pills render in light and dark.

Needs a live check: a real call in FaceTime, Zoom and Meet in a browser while an answer plays.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y

znat and others added 2 commits November 10, 2026 16:49
A watcher reads Core Audio's process objects. Another app that keeps the
mic open for 2 seconds holds the voice; 5 seconds closed ends the call.
ParrotFlow's own recording and the other build's do not count. The menu
says "Paused · Zoom is using the mic" and Resume plays during the call.
A call that ends with answers waiting leaves the voice paused until you
resume. On by default; voice.pause_during_calls turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>
While a call holds answers, the pill says "Voice paused · Zoom is using
the mic" with Resume. When the call ends with answers waiting, it says
"Call over · 3 waiting" with Resume and Not now. Not now keeps the voice
paused and takes the pill away; the menu bar icon still counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 10, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 657b938a-ae1f-40d6-bf51-c931d09958bc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…othing waits

A process with no app, or a background-only app, no longer counts as a
call: com.apple.CoreSpeech held the voice while nobody was on a call.
FaceTime's call service stays in a table. After a call, a new prompt that
drops the last waiting line ends the call's pause, so the pill no longer
says "Call over · 0 waiting".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@znat

znat commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Follow-up fix: e22bce5. The dev log showed a call that was not one.

21:07:08  claude voice: call started (com.apple.CoreSpeech), held
21:07:14  claude voice: pill paused · com.apple.CoreSpeech is using the mic
21:07:49  claude voice: paused until I resume (call over), 1 waiting
21:11:37  claude voice: a new prompt dropped 1 of parrotflow's lines
21:11:37  claude voice: pill call over · 0 waiting

com.apple.CoreSpeech is the system speech service (Siri, dictation). It has the mic open often.

1. System services no longer count. A process counts when it has an app: a Dock-icon ancestor, or its own app record that is not background-only. A process with no app record is a daemon and does not count. FaceTime's calls run in com.apple.avconferenced, a daemon, so it stays in a one-entry table (CallState.callServices). I chose a rule over a deny list, so new Apple daemons need no change.

The second branch (own app record) is there for WebKit's GPU process. Safari, Outlook and Gemini take the mic in "X Graphics and Media", an accessory child of launchd. The cost: accessory apps like Control Centre or LogiTune Helper would count if they opened the mic. If a false call comes back, look there first.

Measured with the real CallWatch.name on this Mac, all audio processes:

  • Not counted: CoreSpeech, assistantd, SiriNCService (background-only), universalaccessd, TelephonyUtilities, mediaanalysisd, both ParrotFlows.
  • Counted: Teams module host and helpers (Microsoft Teams), Chrome helpers, Slack helpers, WebKit GPU processes (their app), avconferenced (FaceTime).

Not verified: iPhone calls through Continuity. If their audio runs in com.apple.TelephonyUtilities and not in avconferenced, they are now missed. Check on the next phone call: grep "call started" ~/Library/Logs/ParrotFlow-Dev.log. If nothing shows, add the bundle that holds the mic to callServices.

2. No bundle id in the pill. MicUser.name is now optional. A process with no readable name never becomes a caller, so it never reaches the pill or the menu. The only name not from an app record is "FaceTime", from the table. The old fallbacks (the bundle id, "another app") are gone because nothing can reach them.

3. No "Call over · 0 waiting". When a new prompt drops the last line held after a call, the call's pause ends: resumed (call over, nothing left). The pause was only there so you choose what happens to those lines. With none left, it would just hold your next answer silently. The pill model also shows nothing for "call over" with an empty list. After Not now, the voice stays paused even if the list empties, because you asked for that. With lines waiting after a call, it stays paused until Resume or Not now, as before.

Tests. New YAML cases: CoreSpeech alone is not a call; avconferenced is FaceTime; CoreSpeech beside Zoom names Zoom; call over with the only line dropped shows no pill. Four of them fail on the old code. check-claude-voice.sh 421/421 + 22/22. make test passes under a scratch config. Local CodeRabbit: 0 findings.

@znat
znat merged commit 2154bf4 into feature/voice-pause Nov 10, 2026
4 checks passed
@znat
znat deleted the voice-pause/5-calls branch November 10, 2026 21:49
znat added a commit that referenced this pull request Nov 10, 2026
* refactor: an answer queue for the coding agents' voice (#436)

VoiceQueue holds the answer playing, the answers waiting and the last 10
heard. A hold puts the playing answer back in front, at the sentence it
stopped on. It plays only when no hold is on: the Pause button and a
dictation are two separate holds. A new prompt drops that session's
answers only. Nothing calls it yet.

The cases are a queue: section in tests/claude-voice-cases.yaml, scored
by --claude-voice-test.


Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat: answers wait while you dictate, then the voice picks up where it stopped (#437)

* refactor: Speaker knows which sentence plays, and can pause

Each chunk carries the index of its sentence in its line. `say` returns
the line id, and `say(sentences:)` takes text that is already split.
`pause()` stops everything and returns the line and the first sentence
not heard in full. `onLineDone` reports a line once it has left, so a
line that fails to synthesize does not leave the queue waiting forever.
No caller uses them yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: answers wait while you dictate, then the voice picks up where it stopped

The hotkey now holds the voice instead of dropping it. The answer that
was playing goes back to the front of the queue. When the recording
ends, the queue plays in order and the held answer resumes at the
sentence it stopped on. Answers, notifications, permission requests and
questions go through `VoiceQueue`. Progress lines do not: they are
dropped while the voice is held or an answer plays.

The session's name is said as a line of its own, so it never moves a
resume index. `VoiceQueue.hold` now counts `stoppedAt` in `remaining`,
the way Speaker counts the line it was given. A 0.5 s timer releases the
dictation hold at the first tick where nothing records, so a press that
never starts a recording does not leave the voice held. `whenFree` and
its 10-minute limit are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* fix: the end of a dictation releases the voice even with a menu open

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat: the pill shows which session speaks, with Pause and Resume (#438)

* feat: one function decides what the voice pill says

`VoicePill.of` turns the queue into the pill's state: the session that
speaks with "2 waiting" or "1 of 3", or "Voice paused" with what waits.
A dictation hold alone shows nothing. `VoiceQueue.resumed` marks a run
that began when a hold let go of a list, so "1 of 3" shows only then.
The new `pill:` cases in tests/claude-voice-cases.yaml score it through
`--claude-voice-test`. Nothing draws it yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: the pill shows which session speaks, with Pause and Resume

The pill now shows during every answer, notification and question, not
only when the session's window is out of sight. It has a Pause button,
and "Go to session" while the window is out of sight. Paused, it says
"Voice paused", counts what waits, and stays until Resume. Progress
lines never raise it.

`ClaudeVoice.onVoicePill` replaces `onPill`. It is sent once the queue
settles after a change, and each second while there is a state, so the
pill comes back after a dictation. `PillState.voice` replaces
`.session` and keeps its priority: it shows only on a free pill.
`--panels speaking` and `--panels paused` replace `--panels session`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat: pause the voice from the menu bar or with ⌃⌥P, for an hour or until tomorrow (#439)

* refactor: each hotkey's events go to the manager that registered it

The Carbon handler fired for any hotkey and returned noErr, so a second
manager's handler swallowed the first one's presses. Each manager now has
its own id, and passes on an event that is not its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: the voice pauses for an hour, until tomorrow or until you resume, as a pure model

VoicePause holds the deadline: tomorrow is the next 8:00 strictly after
now. VoiceMenu gives the Voice section's rows for a state, and which row
the pause shortcut does. Scored by pause_until, pause_restored and
pause_menu in tests/claude-voice-cases.yaml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: pause the voice from the menu bar or with ⌃⌥P, for an hour or until tomorrow

The status menu gets a Voice section: three ways to pause, or Resume
with until when and how many answers wait. The count also shows next to
the menu bar icon. A timed pause ends on a one-shot timer, checked again
on wake. The pause is saved in the app's defaults, so it survives a
relaunch. voice.pause_key, default ⌃⌥P, toggles it; none turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* docs: macOS does not refuse a pause shortcut another app holds

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat: the voice pauses on its own while another app uses the mic (#440)

* feat: the voice holds its answers while another app uses the mic

A watcher reads Core Audio's process objects. Another app that keeps the
mic open for 2 seconds holds the voice; 5 seconds closed ends the call.
ParrotFlow's own recording and the other build's do not count. The menu
says "Paused · Zoom is using the mic" and Resume plays during the call.
A call that ends with answers waiting leaves the voice paused until you
resume. On by default; voice.pause_during_calls turns it off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: the pill says which app holds the voice, and asks after the call

While a call holds answers, the pill says "Voice paused · Zoom is using
the mic" with Resume. When the call ends with answers waiting, it says
"Call over · 3 waiting" with Resume and Not now. Not now keeps the voice
paused and takes the pill away; the menu bar icon still counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* fix: Siri listening is not a call, and the call-over pill goes when nothing waits

A process with no app, or a background-only app, no longer counts as a
call: com.apple.CoreSpeech held the voice while nobody was on a call.
FaceTime's call service stays in a table. After a call, a new prompt that
drops the last waiting line ends the call's pause, so the pill no longer
says "Call over · 0 waiting".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat: see the last answers in the menu and play them again (#441)

* feat: the voice queue plays an answer on request, through a pause

A heard answer can be asked for again, and a waiting one now. It goes
first and plays through a pause or a call, not through a dictation. The
answer it cuts off goes back to the front at its sentence. A pause or a
call takes the ask back. A replay is not added to the heard list twice.

Heard answers keep their audio, newest first, up to about 30 MB of
samples in all. The Answers submenu's rows come from the same queue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* feat: see the last answers in the menu and play them again

The Voice section has an Answers submenu: the waiting answers in play
order, then the last 10 heard. Each row has Play now or Play again, and
Go to session when the window is known.

A replay of an answer said in one go plays its kept audio, so the
remote voice is not called again. Speaker reports each sentence made
whole; a sentence a voice broke on leaves the answer with no audio, and
its replay is made again from the text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

* fix: answer rows line up with the other Voice rows

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
Signed-off-by: Nathan Zylbersztejn <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

---------

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant