Voice Allocation
Overview
The operations listed below are related to voice allocation. Call the function appropriate to each operation.
AXAcquireVoice to acquire a voice The caller must specify a priority for the voice.
AXFreeVoice to free a voice once it is no longer needed
AXSetVoicePriority to adjust the priority of an acquired voice as needed
AXGetDSPCycles to retrieve the number of DSP cycles used by AX during the last audio frame
AXSetMaxDSPCycles to adjust the maximum number of DSP cycles per frame that can can be used by AX
AXGetMaxDSPCycles to retrieve the maximum number of DSP cycles per frame that can be used by AX
Voice Priority
For voice priority, be aware of the following points.
- During each audio frame, AX will first expend DSP cycles on the highest-priority newest voices.
- Thus, older voices of lower priority will be dropped if AX exhausts the allowed DSP cycles before processing all voices.
Voice Reacquisition
For voice reacquisition, be aware of the following.
- If the number of active voices reaches
AX_MAX_VOICES or the maximum number of voices specified when the AX library was initialized, the lowest-priority voice of greatest age will be forcibly reacquired for subsequent acquisition requests.
- Upon reacquiring a voice, AX will invoke the voice's associated callback, if any. Be aware that your application specifies the callback when calling the
AXAcquireVoice function.
- Upon receiving a "dropped voice" callback, you must remove any references to that voice to ensure that it is no longer serviced by your abstraction layer/voice management scheme.
- The user application must not free the voice upon receiving the dropped-voice callback. This is because the voice has been forcibly reacquired by AX. In other words, your application must no longer process this voice.
DSP Load Management
For DSP load management, be aware of the following.
- If DSP takes longer than expected or is otherwise late when processing a frame, AX will begin dropping voices based on priority, and then age. The oldest of the lowest priority voices will be dropped first.
- AX will invoke the associated callback (if any) for each voice, as it is being dropped.
- Upon receiving a "dropped voice" callback, you must remove any references to that voice to ensure that it is no longer serviced by your abstraction layer/voice management scheme.
- The user application must not free the voice upon receiving a "dropped voice" callback.
Revision History
2007/10/02 Revised the entire document following changes to the structure of function reference.
2006/10/23 Changed description for the maximum number of voices.
2006/03/01 Initial version.
CONFIDENTIAL