audio-formats
audio-formats
is meant to be the easiest package to load and write sounds in D.
Features
- β 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
Changelog
audio-formats
v3
π - 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.
audio-formats
v2
π - 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.
audio-formats
v1
π - Initial release.
How to use it?
- Add
audio-formats
as dependency to yourdub.json
ordub.sdl
. - See the transcode example for usage.
What formats are supported exactly?
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.
License
- βοΈ Boost license otherwise.
- βοΈ MIT license when including QOA.
- βοΈ LGPL v2.1 for OPUS. (use DUB subconfigurations) to choose, default is boost.
External links and references
- https://github.com/Zoadian/mp3decoder
- https://github.com/rombankzero/pocketmod
- https://github.com/Artefact2/libxm
Ultra secret options
-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 |
Bugs
-
framesRemainingInPattern
is unimplemented for XM currently.