Add multichannel audio tests and example (stereo, 5.1, 7.1)#150
Open
alexeymohr wants to merge 1 commit into
Open
Add multichannel audio tests and example (stereo, 5.1, 7.1)#150alexeymohr wants to merge 1 commit into
alexeymohr wants to merge 1 commit into
Conversation
Add tests and an example demonstrating how to create AAF files with multichannel audio tracks that Pro Tools recognizes as native stereo, 5.1, and 7.1 tracks. Pro Tools uses an "Audio Channel Combiner" OperationGroup to represent multichannel clips. Each channel gets its own mono mob chain (MasterMob -> SourceMob with PCMDescriptor -> TapeDescriptor SourceMob), and the OperationGroup wraps N SourceClip inputs together. A _TRACK_FORMAT tagged value on the TimelineMobSlot indicates the layout (2=stereo, 3=5.1, 4=7.1). The pattern was discovered by analyzing Pro Tools AAF exports and has been verified to round-trip through both pyaaf2 and Pro Tools. Relates to markreidvfx#145, markreidvfx#102, markreidvfx#93. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
tests/test_multichannel.py— write/read round-trip tests for stereo (2ch), 5.1 (6ch), and 7.1 (8ch) multichannel audio tracks using the Audio Channel Combiner OperationGroup patternexamples/multichannel_audio.py— standalone example script showing how to create multichannel AAFs that Pro Tools imports as native multichannel tracksBackground
Pro Tools represents multichannel audio clips using an "Audio Channel Combiner" OperationGroup (
6b46dd7a-132d-4856-ab21-8b751d8462ec). Each multichannel track has one composition slot containing a Sequence of OperationGroups. Each OperationGroup wraps N mono SourceClips (one per channel), and each channel has its own independent mob chain: MasterMob → SourceMob (PCMDescriptor, mono) → SourceMob (TapeDescriptor).A
_TRACK_FORMATtagged value on the TimelineMobSlot indicates the channel layout:2= stereo (2 InputSegments: L, R)3= 5.1 surround (6 InputSegments: L, C, R, Ls, Rs, LFE)4= 7.1 surround (8 InputSegments: L, C, R, Lss, Rss, Lsr, Rsr, LFE)This is the same OperationDef, same parameters, and same structure for all three formats — only the number of InputSegments and the
_TRACK_FORMATvalue differ.This pattern was discovered by analyzing Pro Tools AAF exports created with "Enforce Media Composer Compatibility" and "Export stereo, 5.1 and 7.1 tracks as multi-channel" enabled.
Notes
NumberInputs=1despite having 2, 6, or 8 actual InputSegments. This matches Pro Tools' own exports. The existingtest_transitions.pyalready registers the sameAvidParameterByteOrderandAvidEffectIDParameterDefs used here.Test plan
python -m unittest tests.test_multichannel -v— all 4 tests passtest_tagged_value,test_dictionarystill pass)python examples/multichannel_audio.pyruns and produces valid AAFsRelates to #145, #102, #93.
🤖 Generated with Claude Code