nw::snd::SoundArchivePlayer::Initialize Member Function

Syntax

#include <nw/snd/snd_SoundArchivePlayer.h>
bool Initialize(
     const SoundArchive* arc,
     const SoundDataManager * manager,
     void         *buffer,
     u32 size,
     void* strmBuffer,
     u32 strmBufferSize
);

Arguments

Name Description
in arc Sound archive used by the player.
in manager Sound data manager used by the player.
in buffer Pointer to the buffer. Must have 32-byte alignment.
in size Buffer size.
in strmBuffer Pointer to the stream buffer. You must specify 32-byte aligned device memory.
in strmBufferSize The size of the stream buffer.

Return Values

Returns true if initialization was successful and false otherwise.

Description

Initializes a sound archive player.

Sound archive players must be initialized before they are used. Initializing the sound archive player associates it with a sound archive and sound data manager; this makes the data in the sound archive playable.

You can get the memory size required by the sound archive player using GetRequiredMemSize and GetRequiredStreamBufferSize.

If the required stream buffer size is 0, you can pass NULL to strmBuffer, the pointer to the stream buffer.

If the stream buffer is configured to be larger than the size obtained with GetRequiredStreamBufferSize, it becomes more difficult for stream sounds to stutter. However, there will be a longer delay between when data is loaded and when it is actually played back.

A device memory address must be specified for the stream buffer. Execution stops on an assert, or false is returned, if the addresses given by strmBuffer and strmBuffer + strmBufferSize do not exist in device memory. (Behavior differs depending on the build target.)

See Also

GetRequiredMemSize
GetRequiredStreamBufferSize
Finalize
IsAvailable

Revision History

2010/03/05
Added what happens when the stream buffer does not exist in device memory.
2010/02/03
Changed the buffer alignment (from 4 to 32)
2010/02/01
Changed the function name Setup to Initialize.
2010/01/15
Initial version.

CONFIDENTIAL