AXAcquireMultiVoice

Syntax

#include <cafe/ax.h>

#define AX_PRIORITY_NODROP  31
#define AX_PRIORITY_LOWEST  1

typedef void (*AXVoiceCallbackEx)(void *p, u32 context, u32 reason);

AXPB_ERROR_CODE AXAcquireMultiVoice (
    u32                 priority,
    AXVoiceCallbackEx   callback,
    u32                 userContext,
    DSPADPCM           *mdsp,
    AXMVPB            **mvp
    );

Parameters

priority Application-assigned priority. Set from 1 (minimum) to 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 of 0 indicates that the voice is not used.
callback Application callback. When a multi-voice is reacquired, AX will call this callback. A pointer to the reacquired AXMVPB is passed via the callback argument p. If the callback does not need to be called, specify NULL.
userContext An application-defined utility variable.
mdsp Pointer to an DSPADPCM structure initialized by the application.
mvp A pointer to a multi-voice pointer.

Return Values

An AXPB error code. One of:

AXPB_ERROR_NONE
AXPB_ERROR_MULTI_VOICE_COUNT_EXCEEDED
AXPB_ERROR_MULTI_VOICE_INVALID_CHANNEL_COUNT
AXPB_ERROR_MULTI_VOICE_UNABLE_TO_ALLOCATE_ALL_VOICES

Description

Acquire and allocate a multi-voice from AX and set the AXMVPB pointer pointed to by mvp. Voice acquisition is priority-based. If enough voices for a complete multi-voice are unavailable, the oldest voice or multi-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.

Voices having priority AX_PRIORITY_NODROP may still be dropped by AX if rendering resources are exceeded for an audio frame.

Availability

Library Version Availability
Sound 2.0 Yes
Sound 1.0 No

Do Not Call From

None.

See Also

AXFreeMultiVoice
AXSetVoicePriority

Revision History

2013/11/15 Add related link
2013/10/20 Initial Version


CONFIDENTIAL