MusFxBankInitialize()

Syntax

void MusFxBankInitialize(void *fxbank);

Arguments

fxbank
the address of a binary sound effect file

Description

It initializes a sound effect bank. If a default sound effect bank is not currently set, make this bank the default sound effect bank. If the sound effect bank has not already been initialized, the list of offsets the bank contains is converted to pointers and the associated sample bank override is cleared.

The default sample bank is used when the MusStartEffect() or the MusStartEffect2() function is used to start sound effects, if no sample bank override has been defined. The MusFxBankSetSingle() function can be used to define a sound effect bank override for the next sound effect started.

The RAM address of a Nintendo 64 Sound Tools .BFX file must be provided in fxbank. The sound effect bank file address must be 32-bit aligned, although it is recommended that it be cache aligned.

Return Value

None

Example

void AudioSetEffectBank(int effect_bank)
{
  /* test if effect bank is already loaded */
  if (effect_bank==last_effect_bank)
    return;
  last_effect_bank = effect_bank;
  /* load effect bank */
  AudioTransfer(fx_address[effect_bank], fx_buffer);
  /* initialize effect bank */
  MusFxBankInitialize(fx_buffer);
  /* set as default effect bank */
  MusFxBankSetCurrent(fx_buffer);
}

See Also

MusFxBankGetCurrent(), MusFxBankSetCurrent(), MusFxBankSetSingle(), MusStartEffect(), MusStartEffect2()