fix: add input channel selection for multi-channel audio interfaces#1254
Open
phinze wants to merge 1 commit intocjpais:mainfrom
Open
fix: add input channel selection for multi-channel audio interfaces#1254phinze wants to merge 1 commit intocjpais:mainfrom
phinze wants to merge 1 commit intocjpais:mainfrom
Conversation
Multi-channel audio interfaces (e.g. Focusrite Scarlett, MOTU M4) expose loopback/output channels alongside mic inputs. Handy averaged all channels to mono, causing music and other audio to bleed into transcription. Add an "Input Channel" dropdown to settings that only appears when the selected microphone has more than one channel. Default is "Average all channels" which preserves the original behavior. Users with multi-channel interfaces can select their mic's specific channel. Fixes cjpais#591
Owner
|
Thanks this looks quite reasonable I will review when I can |
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.
👋 Hello! Cool project. 😄 This is my first contribution so please do let me know if I missed anything!
Please confirm you have done the following:
If this is a feature or change that was previously closed/rejected:
Human Written Description
I have a Focusrite Scarlett Solo 4th Gen as my audio interface. When I started using Handy, I noticed it was transcribing music playing through my headphones even though the music wasn't coming through the microphone. After digging into it, I found that the Scarlett exposes 4 input channels to macOS: channel 0 is the instrument input, channel 1 is the mic, and channels 2-3 appear to be loopback/output channels. Handy averages all channels together to produce mono, which means any audio on those loopback channels gets mixed into the transcription input.
I wanted to fix this in a way that doesn't change anything for people with simple setups. The solution adds an "Input Channel" dropdown that only appears in settings when the selected microphone has more than one channel. The default is "Average all channels" which preserves the existing behavior exactly. People with multi-channel interfaces can select their mic's specific channel to avoid bleed from other channels.
I briefly experimented with auto-detecting the mic channel by sampling peak levels across channels at stream start, but it's fragile (what if music is playing when you start recording?). A simple dropdown felt like the most reliable approach, and it matches what was suggested in #591.
Related Issues/Discussions
Fixes #591
Also related to #998: users with Focusrite Scarletts report that "Mute While Recording" doesn't work because Focusrite drivers don't expose kAudioDevicePropertyMute. Channel selection sidesteps this by not capturing the output audio in the first place. It'd still be cool to also mute or duck the music while recording, but that's a separate concern.
Community Feedback
Multiple users in #591 confirmed the problem across different interfaces (Focusrite Scarlett, MOTU M4) and platforms (macOS, Windows). The suggested solution (a channel dropdown) came directly from a commenter in that thread:
@cjpais closed #591 due to bandwidth but explicitly said PRs are welcome:
Testing
Tested on macOS with my Scarlett Solo 4th Gen (4-channel device). With Channel 2 selected (the mic input), music playing through headphones no longer bleeds into transcription. "Average all channels" still works as before. The dropdown doesn't show up at all for single-channel devices like the built-in mic. Changing the channel takes effect immediately, no restart needed.
Screenshots/Videos (if applicable)
New dropdown:
Disappears with one channel device selected:
AI Assistance
If AI was used:
recorder.rs, wrote most of the implementation, and helped me get a Nix-based macOS build working (the upstream Nix flake is Linux-only). I drove the debugging process, decided on the approach (channel selector with "average all" as default), and tested everything on my Scarlett Solo.