Merged
Conversation
Preserve channel layout during quantization for audio with more than 2 channels. Previously, the quantization step would lose channel layout information, causing issues with multi-channel audio comparison. Also adds a 4-channel audio test and refactors buffer creation helpers to support arbitrary channel counts.
There was a problem hiding this comment.
Pull request overview
This PR adds support for multi-channel audio (more than 2 channels) by preserving channel layout information during the quantization process. Previously, channel layout was lost during quantization, which caused issues when comparing multi-channel audio.
Changes:
- Modified quantization logic to preserve channel layout for buffers with more than 2 channels
- Refactored buffer creation helpers to support arbitrary channel counts with proper layout handling
- Added a new test case for 4-channel audio comparison
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Tests/AudioSnapshotTestingTests/AudioSnapshotTestingTests.swift | Added 4-channel test case and refactored buffer creation to support multi-channel audio with flexible sample rates |
| Sources/AudioSnapshotTesting/Internal/AudioDataComparator.swift | Updated quantization to preserve channel layout for multi-channel audio buffers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hhrvoic
approved these changes
Feb 6, 2026
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.
Preserve channel layout during quantization for audio with more than 2 channels. Previously, the quantization step would lose channel layout information, causing issues with multi-channel audio comparison.
Also adds a 4-channel audio test and refactors buffer creation helpers to support arbitrary channel counts.