feat(riff): Add RF64/BW64 format support for large WAV files#425
Closed
tphakala wants to merge 6 commits intopdeljanov:masterfrom
Closed
feat(riff): Add RF64/BW64 format support for large WAV files#425tphakala wants to merge 6 commits intopdeljanov:masterfrom
tphakala wants to merge 6 commits intopdeljanov:masterfrom
Conversation
added 6 commits
January 4, 2026 19:56
- Add Ds64Chunk struct that parses the ds64 chunk from RF64 files - Extract 64-bit sizes for RIFF, data, and sample count - Add Ds64 variant to RiffWaveChunks enum - Register ds64 chunk in ParseChunkTag implementation - Add placeholder handling in WavReader (skips ds64 for now) - Add unit tests for ds64 parsing with and without table entries
- Add RF64_STREAM_MARKER constant for RF64 file detection - Add Rf64Sizes struct to hold 64-bit sizes from ds64 chunk - Modify try_new to detect RF64 vs RIFF format - Parse ds64 chunk in RF64 files to extract 64-bit data size and sample count - Use 64-bit data size for data_end_pos calculation in RF64 files - Prefer ds64 sample count over fact chunk in RF64 files - Ignore ds64 chunk in standard WAV files (consume bytes but don't use values)
Add a second format descriptor for RF64 files so the probe system can recognize files starting with "RF64" magic bytes.
Add tests for: - RF64 with small data (< 4GB) to verify format parsing - RF64 with large data size metadata to verify 64-bit handling - Standard WAV regression test to ensure no breakage - RF64 without ds64 falls back to 32-bit sizes - ds64 chunk is ignored in standard WAV files
- Add standards reference (EBU Tech 3306) for RF64 implementation - Apply nightly rustfmt formatting as per CONTRIBUTING.md
…rser Follow project convention of using function-local constants for magic numbers that are only used within one function.
Owner
|
Thanks @tphakala for implementing this. I'm happy to accept support for this format to Symphonia, however it'll need to be rebased for If you can point me in the direction of any publicly available test files as well, that would be helpful for me to add to my collection of test vectors. |
This was referenced Feb 16, 2026
Owner
|
Closing this one since the |
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
This PR adds support for the RF64/BW64 file format, which extends the RIFF/WAV format to support files larger than 4GB.
Motivation: Autonomous Recording Units (ARUs) used in bioacoustics and environmental monitoring generate continuous audio recordings that frequently exceed the 4GB file size limit of standard WAV files. These devices output RF64-formatted files to accommodate the large data sizes. Without RF64 support, Symphonia cannot open these files.
Changes:
Ds64Chunkparser for reading 64-bit size informationImplementation Details
RF64 is specified in EBU Tech 3306 (MBWF / RF64: An extended File Format for Audio). Key aspects:
RF64instead ofRIFFas the stream markerds64chunk immediately after the header contains 64-bit sizes0xFFFFFFFFas placeholdersThe implementation:
try_newdata_sizeandsample_countTesting
Test plan
cargo testpassescargo clippycleancargo +nightly fmtapplied