NNS_SndPlayerCreateHeap

Syntax

#include <nnsys/snd.h>
BOOL NNS_SndPlayerCreateHeap(
        int playerNo,
        NNSSndHeapHandle heap,
        u32 size );

Arguments

playerNo The player number.
heap The heap used for allocation of the player heap.
size The size of the player heap.

Return Values

Returns whether the creation of the player heap was successful.

Description

Creates the player heap.

This function creates a player heap of size size in the sound heap heap. Because of the need for a management region in the player heap, more memory is actually consumed than the memory in the size size. The function fails if there is insufficient empty space in the original sound heap heap.

The sound heap that was created is connected to the specified player playerNo. This player heap is used when attempting to play the sequence with the specified player using the NNS_SndArcPlayerStartSeq function.

Repeatedly calling this function appends several player heaps to the specified player playerNo. Generally, this creates only a number of player heaps equal to the maximum number of simultaneous sequence playbacks on each player. (However, If the sound data that is needed for playback is in the sound heap, there is no need to create a player heap.))

Depending on the heap operations on the original sound heap heap, when the region that allocated the player heap is deallocated, the player heap is automatically detached from the player.

Note

This function is called inside the NNS_SndArcPlayerSetup function. If this function is called again, the player heap is appended in such a way that it is added to the settings in the sound archive.

Assign each player the same value for the player heap size size. Connecting a player heap with a different size to one of the players will result in unstable operation such as alternately succeeding and failing when loading data.

See Also

NNS_SndArcPlayerStartSeq
NNS_SndArcPlayerSetup

Revision History

2004/06/01 Initial version.


CONFIDENTIAL