1.2 Data Used in Audio Playback

Here we explain the data needed for audio playback. All of the data talked about here are output as files by the tools in Sound Tools. These are shown in the table below.

 
Name Extension Explanation
Song bin The data for one song(sequence)
Sound effect bank bfx The collection of data for sound effects
Sample wave bank wbk The collection of sample waveform information
Sample pointer bank ptr Information on the address (offset) for each
waveform in the sample wave bank

The sample wave bank data and the sample pointer bank data are always paired. The combination of these two data sets is called the "sample bank," which contains the information for numerous audio waveforms. Each "song" is one song's worth of data. The sound effect bank contains the data for multiple sound effects (their mapping) to play short audio effects.

To playback audio, the data can be combined in two ways: by combining a song with a sample bank, and by combining a sound effect bank with a sample bank. It is OK to use just songs or just sound effect banks. Moreover, numerous songs and sound effect banks can share the same group of sample banks.

The data for songs, sound effect banks and sample pointer banks must all be placed into RAM. In this tutorial, the area in RAM needed for this data is automatically secured from the audio heap. The sample wave bank data, on the other hand, does not normally need to be placed into RAM, although it is possible to specify whether or not to do this at the time of initialization.

(*)When placing the sample wave bank data in RAM you can maintain the data as an array of global variables or in some other manner, but the MUS library specifications require that the data have 32bit alignment. For DMA transfers the data should be cache aligned (16byte alignment) for safety, even though the specs say 8byte alignment is fine.

When exeGCC is being used, N64ALIGN is "on" for environmental variables, so arrays of 1024bytes and larger are always cache aligned. However, arrays that are less than 1024bytes take on 8byte alignment. In such instances, you must clearly state cache alignment. For details, see the exeGCC manual.