Repository navigation
Conversation
Why this is needed: - Previously, when connecting a secondary microphone (e.g., Bluetooth headset or external USB mic alongside the built-in laptop microphone), SpeakType stayed pinned to the previously selected microphone and required opening the full Dashboard -> Audio Input settings to switch inputs. - Users who frequently connect external microphones or switch between multiple connected inputs needed a zero-friction way to switch devices directly from the top macOS menu bar popover and have newly connected microphones become active automatically. Changes: - Auto-switch to newly connected audio input devices via AVCaptureDevice.wasConnectedNotification in AudioRecordingService (while ignoring virtual Teams audio devices). - Reconfigure AVCaptureSession input in-place on audioQueue when switching devices so active/pre-warmed sessions preserve their running state and session clock without interruption. - Add cycleDevice(step:), nextCycledDeviceId(from:currentDeviceId:step:), and selectedDeviceName helpers to AudioRecordingService. - Add a Microphone section to MenuBarDashboardView displaying the active microphone and a direct stacked two-arrow switch button (arrow.left.arrow.right) when multiple microphones are connected. - Document in CHANGELOG.md and AudioInputView, and add unit tests in AudioRecordingServiceTests.
feat(macos): add menu bar microphone switcher and auto-switch on connect
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
Adds direct microphone switching from the top macOS menu bar popover and automatic switching when a new microphone is connected.
Why This Is Needed
Previously, when a user had two or more microphones connected (for example, the MacBook built-in microphone plus an external USB microphone or Bluetooth headset):
What Changed
speaktype/Services/AudioRecordingService.swift):AVCaptureDevice.wasConnectedNotificationand automatically switchesselectedDeviceIdto the newly connected microphone (ignoring virtual Microsoft Teams devices).AVCaptureSessioninputs in-place onaudioQueueusingbeginConfiguration()/commitConfiguration()when a session already exists, so switching microphones while pre-warmed or mid-recording preserves the running session and clock without dropping audio.selectedDeviceId.didSetagainst redundant assignments.speaktype/Views/Components/MenuBarDashboardView.swift):microphoneSwitcherSectiondirectly below the statistics grid in the menu bar popover.arrow.left.arrow.right) that immediately switches/cycles through connected microphones on click without opening the dashboard.CHANGELOG.mdand the helper note inAudioInputView.swift.speaktypeTests/AudioRecordingServiceTests.swiftcovering 0, 1, 2, and 3+ device cycling and wrap-around.