Sound effect

From SM64Decomp Wiki
Jump to navigation Jump to search

Sound effects in Super Mario 64 are played through the special sequence 00_sound_player.s. Although this seems to be an assembly file, assembly macros are used to actually output M64 sequence data, a proprietary format developed for Nintendo games.

Many sound effects are not plain wave data being played back, but use some simple coding for dynamically changing the pitch or playing two sounds simultaneously or sequentially.

The sample IDs that can be found in sound/samples do not relate to the IDs used in the code to play sound effect. Instead, you have to check for which channel the desired sound effect is set up to (see below) and check its table in 00_sound_player.s, such as .channel59_table. The first entry per table has the ID 0x00.

Channels

The sound player sequence uses 10 channels for sound playback. Each channel is purposed for a category of sound effect, hence specific sound effects are available for that channel only.

Channel Description
0 Jump, step, Mario actions etc.
1 Moving, riding, coin
2 Mario's voice
3 and 8 Door, water, coin, chest, platform, cannon, key, yoshi and more
4 Environmental sounds such as waterfall, elevator and wind
5 and 9 Used for object sounds such as enemies, Bowser and cannon
6 Air sounds
7 Menu sounds including camera zoom and power meter