Skip to content

fix: add input channel selection for multi-channel audio interfaces#1254

Open
phinze wants to merge 1 commit intocjpais:mainfrom
phinze:fix/input-channel-selection
Open

fix: add input channel selection for multi-channel audio interfaces#1254
phinze wants to merge 1 commit intocjpais:mainfrom
phinze:fix/input-channel-selection

Conversation

@phinze
Copy link
Copy Markdown

@phinze phinze commented Apr 8, 2026

👋 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:

  • I have explained in the description below why this should be reconsidered
  • I have gathered community feedback (link to discussion below)

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:

"I would expect a dropdown under the device to select a single channel."

@cjpais closed #591 due to bandwidth but explicitly said PRs are welcome:

"I will accept PR's which implement this"

"PRs of all kinds are accepted"

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:

2026-04-08 at 10 40 25@2x

Disappears with one channel device selected:

2026-04-08 at 10 40 35@2x

AI Assistance

  • No AI was used in this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: I'm new to Rust, so I leaned on Claude Code pretty heavily here. It helped me trace the root cause down to the channel averaging logic in 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.

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
@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Apr 8, 2026

Thanks this looks quite reasonable I will review when I can

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.

[BUG] Allow to select channel of devcie to use

2 participants