feat: detect clamshell mode and skip built-in mic when lid is closed#567
Open
pascalwhoop wants to merge 1 commit into
Open
feat: detect clamshell mode and skip built-in mic when lid is closed#567pascalwhoop wants to merge 1 commit into
pascalwhoop wants to merge 1 commit into
Conversation
When a MacBook lid closes in clamshell mode the internal microphone stays visible in CoreAudio's device list but becomes physically inaccessible. The existing kAudioHardwarePropertyDevices listener never fires because no device disconnects, leaving VoiceInk stuck on a non-functional mic. Subscribe to NSApplication.didChangeScreenParametersNotification and check NSScreen.screens for a built-in display using CGDisplayIsBuiltin(). When no built-in display is active the lid is closed and isClamshellMode is set to true, which causes all three device-selection paths (custom, prioritized, fallback) to skip the built-in microphone and pick the next available device. State is seeded at launch so the app behaves correctly when started while already in clamshell mode. Active recordings are never interrupted. Closes Beingpax#566 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Yes, I noticed this as well. And the only way around it for me was to use the priority list with the other microphones above the MacBook Pro one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #566
When a MacBook lid is closed in clamshell mode the built-in microphone stays visible in CoreAudio's device list but is physically inaccessible. The existing
kAudioHardwarePropertyDeviceslistener never fires (nothing actually disconnects), so VoiceInk had no way to know the mic was unusable and kept trying to use it.NSApplication.didChangeScreenParametersNotificationinAudioDeviceManagerto detect display configuration changesCGDisplayIsBuiltin()on each active screen's display ID — when no built-in display is found, the lid is closed (isClamshellMode = true)findBestAvailableDevice,selectHighestPriorityAvailableDevice, andgetCurrentDevice(custom mode)Test plan
🤖 Generated with Claude Code
Summary by cubic
Detects clamshell mode and skips the built-in MacBook mic when the lid is closed, so we auto-select a usable external mic. Fixes #566 and keeps ongoing recordings uninterrupted.
Written for commit 549b890. Summary will update on new commits.