Files
soundcraft/docs/file-format-parity.md
T
Vic Herrera 0acf57228b Import external-WAV AAF as editable session data (pure Rust) (#799)
* Import external-WAV AAF as editable session data

File > Import > Session Data analyzes an AAF and imports the selected audio
tracks as new tracks, one clip per edit. Clips keep their offset into the
complete source, so handles stay available; the import is one undo step and
Save collects the full sources.

crates/interchange (layer 3, no filesystem/process/UI access):
- build_session(Plan): versioned rational-time plan -> Session. Endpoints are
  rounded to samples independently, so adjacent edits never drift.
- aaf::read_aaf: reads the AAF object model from structured storage with the
  cfb crate (MIT): properties streams, strong reference vectors/sets and
  dictionary weak references. Media goes through a MediaResolver trait.

crates/engine: file.preview_aaf (read-only) and file.import_aaf (undoable).
The resolver opens only files named in the chosen media folder, checks
file_access and reads WAV headers without loading samples; import re-probes
and decodes before touching the session.

crates/ui-egui: Session Data window with track selection, media folder,
absolute/relative mapping, sample offset and report.

Supported: SourceClip/Filler sequences resolved through MasterMobs to
WAVEDescriptor SourceMobs with one external locator; mono/stereo PCM WAV;
composition timecode including 24000/1001 and drop-frame. Gain, fades,
transitions, selectors, nested sequences, embedded essence, split channels,
mixed sample rates and non-local locators fail explicitly.

Addresses #40.

* AAF import: resolve each source once, offer composition choice, start folder picker

- file_source returns early for a known source, so each WAV is probed and
  each relink is reported once however many edits use it. The per-slot
  PhysicalTrackNumber check still runs first.
- When an AAF holds several compositions, the Session Data window lists them
  and passes the chosen MobID to file.preview_aaf.
- "Choose media folder..." opens at the current media folder instead of
  receiving a label as its start path.

* AAF import: lock the composition selector while analysis runs

A selection change during analysis could leave a plan for the previous
composition in the window and enable Import with it.

* AAF import: drop a running analysis when the file or media folder changes

window.import_aaf (and opening an .aaf) can set a new path while the
previous file is still being analyzed; its late plan could then be shown and
imported for the new path.

* AAF import: forget the chosen composition when the path is edited

* AAF import: keep the media folder with a typed AAF path

A typed path now moves a media folder that was derived from the previous
AAF, so same-named WAVs are not taken from the old folder. A folder the user
chose elsewhere is kept.

* AAF import: bound hostile input, confine locators, report missing media

Review follow-up for the AAF reader (untrusted input):
- Cap the structured-storage directory at MAX_DIRECTORY_ENTRIES on open;
  document every bound (sector chains via cfb, 32 MiB streams, MAX_ITEMS
  collections, 32-link source chains with cycle detection).
- Locators are data: refuse `..` anywhere (also percent-encoded and inside
  absolute paths), NUL bytes, paths that name no file, and relative
  locators with a root or drive prefix; relative ones stay under the AAF's
  folder.
- A missing media file no longer aborts the import: it is reported with
  the number of edits skipped, the other edits keep their positions, and
  the import fails only when no referenced file exists.
- Tests: looped directory, mini-FAT and mini-stream chains terminate with
  an error; locators patched into the fixture cannot leave the AAF folder;
  an absolute locator is only looked up in the chosen media folder;
  missing media is reported per file.
- Provenance statement in the module docs and README.

* AAF import: confine the plan's media to the media folder at import too

file.import_aaf takes the plan from its caller (UI, MCP, automation), so
the media-folder rule applied while analysing is checked again before any
source is read: the import requires `media_dir`, and every source must be a
file directly inside it once both paths are canonical (symlinks resolved).
The UI passes the folder it analysed with.

Test: a plan edited to point outside the folder (absolute path, `..`
traversal, symlink) or without `media_dir` is refused without an edit.

* AAF reader: decode UTF-16 with as_chunks for clippy 1.99

clippy::chunks_exact_to_as_chunks (Rust 1.99, used by the gate) rejects
chunks_exact(2) with a constant size. as_chunks is stable since 1.88, below
the workspace minimum.

* AAF reader: state its provenance accurately

The storage layout, class and property identifiers and MobID text form
were learned by reading pyaaf2 (MIT), not from the published AAF
specifications. No pyaaf2, AAF SDK or copyleft code was copied.

* aaf: bound property expansion

Cache parsed objects and share property payloads. Enforce a 128 MiB aggregate property budget and reject duplicate local references before expansion, with a compact AAF regression. Migrate AAF media handling to craft-audio after integrating current main.

* docs: record strict AAF import support
2026-11-19 10:43:36 -06:00

6.7 KiB
Raw Blame History

File-format parity

Last reviewed: 2026-11-14 · Last updated: 2026-11-14 · Change: minor (strict external-WAV AAF import; previously minor: audio formats come from craft-audio) · Target: Avid Pro Tools Ultimate 2026.4.1

Every format Pro Tools reads or writes, and ours. The Pro Tools list comes from the document types its bundle declares (CFBundleDocumentTypes in Info.plist: names only, nothing else read) and its documented import/bounce options. Ours comes from craft-audio in craft-libs (DECODE_EXTENSIONS, ENCODE_EXTENSIONS, detect_container, decode), crates/engine/src/cmd/file.rs, crates/engine/src/score.rs, crates/engine/src/clip_group_file.rs and crates/video.

File formats: ~40 % ready (estimated: weighted by how often a Pro Tools user hits each row; session interchange carries a third of the weight and has only a strict AAF import subset). Remaining ≈ 70–120 h.

Legend: ✅ supported and tested · 🟡 partial · ❌ missing · — not applicable.

Sessions and interchange

Format Pro Tools Read Write Tests / notes
Pro Tools session .ptx (and .ptf from 7–9) native ❌ ❌ Proprietary, undocumented. Owner decision needed on black-box format study (G-03)
Session templates .ptxt read/write ❌ ❌ We have no templates at all (G-16)
AAF (Advanced Authoring Format) import/export 🟡 ❌ #40. Strict subset: CompositionMob SourceClip/Filler edits with external mono/stereo PCM WAV; editable clips, handles, relink and timecode mapping. Gain, fades, transitions, embedded essence, split channels, mixed rates and export are unsupported (G-03)
OMF import/export ❌ ❌ Legacy, still delivered by some editors
Media Composer–compatible session export ❌ ❌ AAF variant
ADM BWF (Dolby Atmos master) import/export ❌ ❌ G-12
SoundCraft session .scraft + Audio Files/ — ✅ ✅ JSON (serde); mutated-file property test loads or fails cleanly; plugin state embedded. Fades save optional curvature (-1..1); missing values default to 0 and preserve legacy envelopes
Import Session Data (from another session) Pro Tools sessions 🟡 — From .scraft only
Session info as text export — ✅ file.export_session_text
Clip groups .rgrp / ours .scgrp read/write 🟡 🟡 Our own .scgrp format; Pro Tools' clip-group files not read
Track presets, fade presets, I/O settings, workspace, sync settings read/write ❌ ❌ Their equivalents don't exist yet (G-16)

Audio

Format Pro Tools Read Write Tests / notes
WAV / BWF (PCM 16/24/32, float 32), bext native ✅ ✅ Native reader/writer, TPDF dither option; Float32 retains finite headroom (#791); also 8-bit and float 64 read. An empty data chunk followed by metadata reads as no audio; an unfinalised recording's audio is still read (#466). WAV bounces (mix and stems) carry a bext TimeReference: the session's timecode start plus the bounce start (#1296).
RF64 / BW64 (> 4 GiB) read/write ✅ ✅ Written above 4 GiB (EncodeOptions::with_force_rf64 below it)
WAV WAVE_FORMAT_EXTENSIBLE multichannel with channel mask read/write ✅ ✅ EncodeOptions::with_layout; default 5.1 import creates a stereo track (#89, PR #128)
AIFF / AIFF-C native ✅ ✅ (fl32) Native; fl32 retains finite headroom (#791)
FLAC import ✅ (symphonia) ✅ craft-audio's encoder
MP3 import, bounce ✅ (symphonia) ❌ G-21
AAC / M4A / MP4 audio import, bounce ✅ ❌ craft-audio's AAC-LC decoder; HE-AAC decodes its AAC-LC core only. MP4 and Matroska tracks import at their presentation length (edit list applied). G-21
ALAC import ✅ ❌
Ogg Vorbis — ✅ (symphonia) ❌ Beyond Pro Tools
Opus (Ogg, WebM, MP4), AC-3 / E-AC-3, MP1 / MP2 — ✅ ❌ craft-audio's decoders; E-AC-3 7.1 imports as its 5.1 downmix
CAF — ✅ (symphonia) ❌
Sound Designer / SD II import (legacy) ❌ — Rare today
ReCycle / REX import ❌ — Loops
MXF audio (OP-Atom, OP1a) import ❌ ❌ Avid media; FilmCraft has an MXF reader to learn from
iXML / polyphonic field-recorder metadata read ❌ ❌ G-17
Peak overviews .wfm cache ✅ (own, in memory) — craft_audio::peaks; not cached on disk

MIDI and notation

Format Pro Tools Read Write Tests / notes
Standard MIDI File (type 0/1) import/export ✅ 🟡 Exported MIDI omits imported controllers and ignores the tracks filter (#87, #98; PR #125)
MusicXML (to Sibelius) export — ✅ file.export_sibelius, score.rs
Printable score print — ✅ (SVG)

Video

Format Pro Tools Read Write Tests / notes
QuickTime / MP4, H.264 import, bounce ✅ ❌ Own pure-Rust decoder (Baseline/Main/High); mutated-movie fuzzing
ProRes (all flavours) import ✅ ❌ Own decoder
Motion JPEG import ✅ ❌
HEVC, AV1 import ❌ ❌ G-17
DNxHD / DNxHR, MXF video import ❌ ❌ G-17
Bounce with video export — ❌ G-17

Plugin and preset files

Format Pro Tools Ours
AAX plug-ins the only format it hosts ❌ (cannot: Avid SDK licence, PACE signing)
VST3 / Audio Units / CLAP — (AAX only) ✅ hosted (ahead of Pro Tools)
Plug-in settings .tfx read/write ❌ (our own JSON presets per plugin)

Revision history

Date Change Summary
2026-11-14 minor Strict external-WAV AAF import with editable clips, relink and timecode mapping; export and the wider AAF/OMF feature set remain unsupported; readiness estimate unchanged
2026-11-11 minor Audio formats come from craft-audio (craft-libs); crates/audio-io is gone. New on import: Opus, AC-3/E-AC-3, .mov/.mka audio; AAC, ALAC and MP2 no longer go through symphonia; .aifc is a writable name
2026-11-02 trivial WAV bounces (mix and stems) write a bext TimeReference: session timecode start plus bounce start (#1296)
2026-10-19 trivial WAV and AIFF-C Float32 encoders retain finite headroom (#791); whole-file, streaming and bounce regression tests
2026-10-13 trivial WAV: empty data chunk with trailing metadata (#466)
2026-10-13 minor Fade curvature round-trips in sessions with a zero default for older files. Format version and readiness estimate unchanged
2026-10-10 major Created: format inventory against Pro Tools 2026.4.1's declared document types and import/bounce options