alSynStartVoice alSynStartVoice (function)

alSynStartVoice, n_alSynStartVoice

Starts synthesizing audio samples with the specified voice

Syntax

#include <libaudio.h>     /* libaudio.h */
     
void alSynStartVoice(ALSynth *drvr, ALVoice *voice, ALWaveTable *table);
#include <n_libaudio.h>     /* n_libaudio.h */
 
void n_alSynStartVoice(           N_ALVoice *voice, ALWaveTable *table);

Arguments

drvr
Pointer to the synthesizer driver

voice
Pointer to a voice structure

table
Pointer to a wavetable structure (Holds data regarding storage location of a sampling sound)

Description

alSynStartVoice begins generating entries into the command lists created by alAudioFrame to synthesize audio samples for the given voice from sample data in the wavetable pointed to by the table. Before calling this function, use the specified arguments to allocate the voice from the driver by calling alSynAllocVoice.

The alSynAllocVoice function isn't always successful, so be sure to check the result before you call alSynStartVoice. Before starting a voice, the pitch, pan, fxmix, and volume should be set.

When the voice is no longer sounding, alSynStopVoice first, and then alSynFreeVoice may be called.

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

Note

When you are writing a custom player, this function (alSynStartVoice) should be called only from within an ALVoiceHandler. Also, do not set any of the voice's arguments (for example, don't call alSynSetVol) if the voice is in the stopped state unless the voice is started in the same audio frame. If you call a function to set a stopped voice's arguments and the voice is not started until one or more frames later, you'll get unexpected results.

See Also

alSynAllocVoice, alSynStopVoice, alSynFreeVoice, alSynSetPitch, alSynSetPan, alSynSetVol, alSynSetFXMix, alSynStartVoiceParams, and alAudioFrame

Revision History

1999/04/30 Changed Format