Swift package for Apple platforms for performant parsing, reading, and writing of RIFF files.
This package currently offers:
- a lightweight abstraction for parsing chunks in RIFF-based files, and overwriting chunks in existing files
- abstractions for some file specifications that use RIFF as their underlying file format (such as WAV files)
At present, baseline functionality is implemented and unit tested. The initial goal of this library is to offer a mechanism to read the structure of RIFF files, with very limited mechanisms for writing. In the future, a full set of methods for authoring and writing to RIFF files would be added to the library ideally.
SwiftRIFF
: umbrella package target loads all package modules including additional file specification abstractions (ie: WAV)SwiftRIFFCore
: package target offers the basicRIFFFile
type which allows parsing any generic RIFF-based file- Custom RIFF chunk abstractions may be built by adopting the
RIFFFileChunk
protocol and passing these custom types into theRIFFFile
parser so it can identify them during parsing (For an example, see theWAVFile
type and its chunk implementation)
- Custom RIFF chunk abstractions may be built by adopting the
SwiftRIFFWAV
: WAV file specification abstraction (which uses RIFF as its underlying file structure)
Add this package to your Xcode project or Swift package using https://github.com/orchetect/SwiftRIFF
as the URL.
There is no format documentation at this time, but most types and methods in the package have inline documentation to help explain their purpose.
See the Examples folder for a quick way to get started with parsing RIFF files.
See the SwiftRIFFWAV
package target for a blueprint of how to implement your own custom abstractions for RIFF-based files and chunks.
These features are not yet implemented, but are planned for the future. There is no timeline for these additions, but they may be added on an as-needed basis.
-
RIFF files
- Authoring new RIFF files
- Replacing RIFF file chunk with chunk of different byte length
- Adding new chunks to RIFF files
- Removing chunks from RIFF files
-
Broadcast Wave (BWAV): Implement abstractions for additional known chunk types (
iXML
,qlty
,mext
,levl
,link
,axml
) -
Implement RF64
-
Implement RIF2 (New 64-bit Cubase 13/Nuendo 13 file format)
Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself @orchetect.
Licensed under the MIT license. See LICENSE for details.
If you enjoy using SwiftRiff and want to contribute to open-source financially, GitHub sponsorship is much appreciated. Feedback and code contributions are also welcome.
Please do not email maintainers for technical support. Several options are available for issues and questions:
- Questions and feature ideas can be posted to Discussions.
- If an issue is a verifiable bug with reproducible steps it may be posted in Issues.
Contributions are welcome. Posting in Discussions first prior to new submitting PRs for features or modifications is encouraged.