alSynAllocVoice alSynAllocVoice (function)

alSynAllocVoice, n_alSynAllocVoice

Allocates a synthesizer voice


#include <libaudio.h>     /* libaudio.h */
s32 *alSynAllocVoice(    ALSynth *drvr, ALVoiceConfig *vc);
#include <n_libaudio.h>     /* n_libaudio.h */
s32 n_alSynAllocVoice(N_ALVoice *voice, ALVoiceConfig *vc);


Pointer to the synthesizer driver

Pointer to a voice structure

Pointer to a voice configuration structure


It uses an argument specified in the voice configuration structure to allocate to virtual voice. It returns the pointer to a voice structure when it is possible to allocate virtual voice. If it fails to allocate, alSynAllocVoice returns 0. 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 alSynAllocVoice, it returns the pointer to the virtual voice, and no new voice will be pronounced. Note that voice stealing occurs only when there are more virtual voices than physical voices.

The arguments in the ALVoiceConfig structure are as follows:

Voice's playback priority

Auxiliary effect bus to which the voice is assigned. Currently there is
only one auxiliary bus

Flag that is set to specify for the voice to be played at a pitch of 1.0.

For details on n_audio library, see "Chapter 28: n_audio library" in the N64 Programming Manual.


Call alSynAllocVoice only from within the ALVoiceHandler.

See Also

alSynFreeVoice, alSynStartVoice, and alSynStopVoice

Revision History

1999/04/30 Changed Format