audio-formats
is meant to be the easiest package to load and write sounds in D.
- ✅ Decode from WAV / QOA / MP3 / FLAC / OPUS / OGG / MOD / XM
- ✅ Encode to WAV / QOA
- ✅ File and memory support
- ✅ Seeking support
- ✅ Chunked support
- ✅
float
anddouble
support - ✅ Encoding with dithering when reducing bit-depth
- ✅
nothrow @nogc
API - ✅ Archs:
x86
/x86_64
/arm64
- Complete removal of exceptions. The API is now 100%
nothrow @nogc
.AudioFormatsException
doesn't exist anymore. - BREAKING Instead, use
.isError
and.isValid
to check for errors.
- Doesn't depend upon
dplug:core
anymore. - All exceptions thrown by
audio-formats
are nowAudioFormatsException
.
They must be clean-up withdestroyAudioFormatException
. - v2.1 QOA format decoding support (https://github.com/phoboslab/qoa). Note that the QOA bitstream isn't finalized, and will change.
- v2.2 QOA format encoding support.
- Initial release.
- Add
audio-formats
as dependency to yourdub.json
ordub.sdl
. - See the transcode example for usage.
Decoding | Encoding | Seeking support | |
---|---|---|---|
📀 WAV | Yes | Yes | Sample |
📀 MP3 | Yes | No | Sample |
📀 FLAC | Yes | No | Sample |
📀 OPUS | Yes (LGPL) | No | Sample |
📀 OGG | Yes | No | Sample |
📀 QOA | Yes | Yes | Sample |
📀 MOD | Yes | No | Pattern+Row |
📀 XM | Yes | No | Pattern+Row |
Some of these decoders were originally translated by Ketmar, who did the heavy-lifting.
- ⚖️ Boost license otherwise.
- ⚖️ MIT license when including QOA.
- ⚖️ LGPL v2.1 for OPUS. (use DUB subconfigurations) to choose, default is boost.
- https://github.com/Zoadian/mp3decoder
- https://github.com/rombankzero/pocketmod
- https://github.com/Artefact2/libxm
-The following version
identifiers can be used to enable/disable decoder level features
Version Identifier | Feature |
---|---|
AF_LINEAR | Use linear sampling for MOD modules instead of Amiga sampling |
framesRemainingInPattern
is unimplemented for XM currently.