Repository navigation
Keep the first input when raw capture folds a discrete-layout device into mono, instead of recording silence - #77
Open
AndrewYakovlev wants to merge 2 commits into
Conversation
…into mono, instead of recording silence AVAudioConverter maps no input channel to mono for a discrete channel layout, which is how audio interfaces present their inputs, so the mic track came out as digital zeros. Taking input 1 matches what the converter already does for a stereo microphone.
…presents, which gsamat#65 found recording silence the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #57.
The fix is Ilia Ablamonov's, from his fork (Flamefork/amanu@eba46e8). It was described in #57 but never opened as a PR, so I have carried it over with his authorship. For a discrete channel layout,
AVAudioConvertermaps no input channel to the mono output (channelMap == [-1]). Audio interfaces present their inputs this way, and the raw mic track came out as digital zeros. The converter now takes input 1 in that case, which is what it already does for a stereo mic.My second commit adds a three-channel case to the test. #65 found that a newer MacBook's built-in microphone presents three discrete channels and records silence after a route change, so this bug affects built-in microphones too, not only studio interfaces. Without the fix, the 2-, 3- and 14-channel cases all fail. With it, they all pass. The full
swift testrun passes, except the locale-dependentMeetingLanguagesTestscase that fails onmastertoo.Not tested on real hardware here. Ilia reports −3 dB peaks from a Babyface Pro with the change.
🤖 Generated with Claude Code