#include <revolution.h> #define AX_PRIORITY_NODROP 31 #define AX_PRIORITY_LOWEST 1 typedef void(*AXVoiceCallback)(void *p); AXVPB* AXAcquireVoice(u32 priority, AXVoiceCallback callback, u32 userContext);
priority |
Application-assigned priority. Set from 1 (minimum) - 31 (maximum). 31 is the highest priority. AX_PRIORITY_NODROP is defined as 31. AX_PRIORITY_LOWEST is defined as 1. Voices acquired with AX_PRIORITY_NODROP will not be eligible for reacquisition. Priority 0 means that the voice is empty. |
callback |
Application callback. AX invokes this callback if a voice is reacquired ("dropped"). NULL means no callback is to be invoked. |
userContext |
Application-defined "utility" variable. Passed as an argument to the callback. |
Pointer to the voice's associated AXVPB. NULL if acquisition failed.
AXAcquireVoice() attempts to acquire a voice from AX. Voice acquisition is priority-based. If a free voice is not available, the oldest voice of lowest priority (and lower than the requested priority) will be forcibly reacquired to fulfill the request. (Voices having priority AX_PRIORITY_NODROP cannot be reacquired by this method.) However, such voices may still be dropped by the AX if DSP resources are exceeded for an audio frame. Priority for a voice may be reassigned after acquisition by using AXSetVoicePriority().
AXFreeVoice
AXSetVoicePriority
03/01/2006 Initial version.