AXVoiceBegin

Syntax

#include <cafe.h>
#include <cafe/ax.h>

s32 AXVoiceBegin(AXVPB *p);

Parameters

p Pointer to the AX Voice management structure to be protected.

Return Values

AXSYNC_ERROR_IN_USE Voice is protected by another thread. Try again later.
AXSYNC_ERROR_IN_CALLBACK Attempted to call AXVoiceBegin from inside a callback handler.
>= 0 Protection state for this voice has been asserted.

Description

Asserts a protection state for the specified voice.

During a protection state any changes to the parameters of the specified voice, made via the AXSetVoice... functions, will be buffered until the protection state is terminated (AXVoiceEnd).

After the protection state is terminated, the buffered parameters can be committed to the renderer at the next audio frame.

It is possible to nest BEGIN/END clauses. Note that the nesting limit is equal to AX_MAX_VOICES.

AXSYNC_ERROR_IN_CALLBACK

Making this call from a callback handler will return AXSYNC_ERROR_IN_CALLBACK but have no other effect. Nor will its matching AXVoiceEnd call have any effect.

It is possible to get a return value of AXSYNC_ERROR_IN_CALLBACK from calls not made during the callback handler. This is an indication of a programming error elsewhere in the application, such as:

Availability

Library Version Availability
Sound 2.0 Yes
Sound 1.0 Yes

Do Not Call From

None.

See Also

AX Programming Model Overview
AXUserBegin
AXUserEnd
AXUserIsProtected
AXUserEnd
AXVoiceIsProtected

Revision History

2013/05/08 Automated cleanup pass.
2011/03/02 Initial version.


CONFIDENTIAL