Technology1 min read

Why This Obscure Audio Codec Is a Perfect Fit for the N64

By · Published by Everything Blog

In short

Historically, cartridge sizes between 8MB and 64MB restricted game music largely to MIDI trackers and ADPCM compression, where a single five-minute track consumed about 12MB. More contemporary decoders like Opus and MP3 place too high a burden on the 93 MHz processor to run effectively during live gameplay. ULC overcomes these restrictions by cutting complex features like subband splitting and Huffman coding in favor of a simpler nibble-based syntax. Consequently, the console can stream 44100 Hz stereo sound at near-Opus bitrates while requiring roughly 4% of the processor's active time.

Key points

  • Modern open-source decoders such as Opus demand too much processing power to function smo…: Modern open-source decoders such as Opus demand too much processing power to function smoothly alongside active N64 gameplay.
  • Eliminating Huffman coding and subband splitting enables the codec to bypass the system's…: Eliminating Huffman coding and subband splitting enables the codec to bypass the system's strict computing bottlenecks.
  • The format utilizes a straightforward nibble-based syntax to store transform coefficients…: The format utilizes a straightforward nibble-based syntax to store transform coefficients without demanding complex hardware adaptation.

Sources checked by our analysis pipeline: 1

Sorry for the clickbait title. I promise this post delivers: 44100 Hz stereo with near-Opus bitrates using about 4% of the N64’s CPU time.

But first, some history: The options for playing and storing audio data on the N64 were dire. The PlayStation could just stream uncompressed redbook audio straight from the CD. On the N64, cartridge space was at a premium and time on the 93 MHz CPU was limited.

Worse, access to the vector co-processor, the RSP, was guarded by Nintendo for the longest time. Nintendo's own platform library, Libultra, internally used the RSP for various graphics and sound-related tasks, but Nintendo didn't allow third-party developers to directly write code for it.

Libultra provided some functions to transparently play back compressed audio using an ADPCM scheme (adaptive differential pulse code modulation). The RSP handled decompression on the fly, just before the audio was sent to the output buffer.

This works well enough and cuts the space needed for a sample by a factor of 4. Still, a 5-minute stereo audio track at 44100 Hz will land at about…

Technology