N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential

   

alSynAllocVoice

Format
#include <libaudio.h>
s32 alSynAllocVoice(ALSynth *drvr, ALVoice *voice, ALVoiceConfig *vc);


Arguments
  • drvr is the pointer to the synthesizer driver
  • voice is the pointer to a virtual voice to be initialized and allocated a physical voice
  • vc is the pointer to a voice configuration structure
What This Function Does
It initializes the virtual voice using the arguments specified in the voice configuration structure, and it allocates a physical voice to the initialized virtual voice. If there are no physical voices available, it tries to steal a physical voice from another virtual voice. To do this, it searches the list of voices and steals the physical voice with the lowest priority voice that is equal to or lower than the priority specified in the configuration structure. If no physical voice is found with an equal or lower priority or if an error occurs, it returns 0 to indicate failure. If a physical voice is allocated and no errors occur, it returns 1 to indicate success. Note that voice stealing occurs only when there are more virtual voices than physical voices.

The arguments in the ALVoiceConfig structure are as follows:
  • priority is the voice's playback priority.
  • fxBus is the auxiliary effect bus to which the voice is assigned. Currently there is only one auxiliary bus.
  • unityPitch is a flag that when set specifies that this voice is to be played at a pitch of 1.0.
Warning
Call this function from within an ALVoiceHandler only.

See Also
alSynFreeVoice
alSynStartVoice
alSynStopVoice



Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998