#include <cafe/ax.h>

typedef void    (*AXUserAuxCallback)    (s32 **data, void *context, AXAUXCBSTRUCT *info);

AXPB_ERROR_CODE AXRegisterAuxCallback(AXPBDeviceType device, u32 Id,
					u32 auxId, AXUserAuxCallback fcb, void *context);


device Output device.
Id Device instance.
auxId Aux bus.
fcb The callback function to invoke for Aux processing.
context Pointer to an application-defined structure; passed directly to the callback.

Return Values

AXPB_ERROR_NONE if successful, an error of type AXPB_ERROR otherwise.


Registers callback function fcb to the Aux bus auxId, for the output device specified by device and Id.

The callback will be invoked once per audio frame and is responsible for applying an effects algorithm (such as reverb) to the specified Aux bus.

The callback must be of type AXUserAuxCallback, which defines the following parameters:

    typedef struct _AXAUXCBSTRUCT

        u32 numChs;     // number of channels pointed by s32 **data in cb
        u32 numSamples; // number of samples in each of the channels


    typedef void (*AXUserAuxCallback)(s32 **data, void *context, AXAUXCBSTRUCT *info);

When invoked, the callback will receive data, which points to an array containing the contents of the Aux bus auxId. The structure pointed to by info describes the dimensions of the given Aux bus.

The callback will also receive the context pointer specified when the AXRegisterAuxCallback was invoked. The pointer is not modified or otherwise examined by AX. It is passed from the application to the callback function, and is meant to facilitate communication between the two.

The callback is invoked from the AX application I/O thread, which has a higher priority than application threads. All standard thread synchronization methods apply. For more information, see Basic Thread Scheduling.


Library Version Availability
Sound 2.0 Yes
Sound 1.0 Yes

Do Not Call From


See Also

Cafe Core OS (COS) Overview
AX Data Structures and Definitions

Revision History

2015/06/01 Fixed links to Basic Thread topic.
2013/05/08 Automated cleanup pass.
2012/01/26 Update to Audio API v2.0.
2011/02/21 Initial Version