DragonMinded / libdragon

Open source library for N64 development.
https://libdragon.dev
The Unlicense
674 stars 98 forks source link

Preview merge: add VADPCM support to wav64 #529

Closed rasky closed 2 months ago

rasky commented 2 months ago

VADPCM is a special type of ADPCM compression that can be decompressed with a pure IIR filter, which is a good fit for RSP. It is extremely lightweight at runtime (it's basically a free) and still provide a decent compression ratio for 16-bit files (32:9, which is 3.5:1).

VADPCM has been independently reversed and clean-room implemented by Vanadium. audioconv64 uses his library for compressing the files (part of Skelly64, which has been vendored), while the playback code running on RSP was written by me.

Given the very good balance between ratio and speed, audioconv64 now compressed wav64 with VADPCM by default. --wav-compress can be used to disable that, by specifying level 0.

In addition to this, we did other improvements to audioconv64:

This means that it's now easier for a game to store original assets in (eg) MP3 at 192 Kbps, and then decide via the Makefile how to downsample/convert them.