Skip to main content

Module decoder

Module decoder 

Source
Expand description

MOD codec decoder — ProTracker playback.

Consumes the whole-file packet from the MOD container, parses the header + patterns + sample bodies, and drives a PlayerState forward, emitting PCM until the song ends.

Two output modes are available:

  • [ModDecoder] (codec id crate::CODEC_ID_STR = "mod") produces mixed stereo S16 interleaved PCM. One AudioFrame every CHUNK_FRAMES samples.
  • [ModPlanarDecoder] (codec id crate::CODEC_ID_PLANAR_STR = "mod_planar") produces one planar AudioFrame per tick, with one S16P plane per MOD tracker channel. Downstream consumers that want to mix / pan / analyse channels independently (DAWs, visualizers, per-instrument tooling) drive the decoder via this codec id.

Functions§

register