Jazz2::AssetPacker::Wav64Writer class

Writes libdragon's .wav64 audio files.

This is libdragon's audioconv64 (conv_wav64.cpp, version 10 of the format) reimplemented on top of the same codecs, so a Nintendo 64 tree can be made without the libdragon toolchain - which is what the web build of the tool relies on. The output is meant to match audioconv64 byte for byte for the options this tool uses: VADPCM without the Huffman stage (--wav-compress vadpcm,huffman=false), and ULC in its default variable-bitrate mode (--wav-compress ulc).

Public static functions

static auto Write(BigEndianWriter& out, Wav64Audio& audio, Wav64Format format, StringView displayName) -> bool
Writes audio at the end of out.
static auto ReadWave(Death::IO::Stream& s, Wav64Audio& audio, StringView displayName) -> bool
Reads a RIFF WAVE file as audioconv64 does.

Constructors, destructors, conversion operators

Wav64Writer() deleted

Function documentation

static bool Jazz2::AssetPacker::Wav64Writer::Write(BigEndianWriter& out, Wav64Audio& audio, Wav64Format format, StringView displayName)

Writes audio at the end of out.

Offsets inside the file are relative to where it begins, so it can be part of a larger file, as the samples of a .xm64 module are. The audio is adjusted the way the format needs - the loop of a VADPCM or ULC file is rotated to begin on a block boundary and the audio is padded to whole blocks - and the adjusted lengths are left in audio for the caller to pick up.

static bool Jazz2::AssetPacker::Wav64Writer::ReadWave(Death::IO::Stream& s, Wav64Audio& audio, StringView displayName)

Reads a RIFF WAVE file as audioconv64 does.

PCM of 8 to 32 bits and floating-point data are converted to 16-bit samples, the first loop of a smpl chunk becomes the loop and cue points become skip points.