nw::snd::SoundStartable::StartInfo Structure

Header file: nw/snd/snd_SoundStartable.h

Syntax

struct StartInfo
{
   u32 enableFlag;
   StartOffsetType startOffsetType;
   int startOffset;
   SoundArchive::ItemId playerId;
   int playerPriority;
   int actorPlayerId;
   SeqSoundInfo seqSoundInfo;
};

Description

These are detailed playback parameters that are passed during sound playback.

They are passed to functions such as nw4r::snd::SoundStartable::StartSound. Even if this structure is not used, sounds can be played back.

You can start playback from part way through a sound if startOffsetType and startOffset are set. You must set both of these parameters at the same time. To enable the set parameters, set the ENABLE_START_OFFSET bit of the enableFlag.

Even if the offset values are the same, the processing time required for midstream playback may vary, depending on the type of data. This sometimes takes a large amount of processing time.

Sequence Sound
If you want to idle a sequence until part way through, the larger the size of the start offset, the longer the processing time.

Stream Sound
If the data is PCM, there is almost no processing time taken for midstream playback, regardless of the size of the start offset. If the data is ADPCM, it requires processing by the CPU for decoding the data for a maximum of 14336 samples.

Stream Sound
If the data is PCM, there is almost no processing time taken for midstream playback, regardless of the size of the start offset. If the data is ADPCM, the processing time that is taken corresponds to the size of the start offset because all samples from the start of the data through the playback starting position must be decoded by the CPU.

Sounds are played back using the player whose ID is set in the sound archive. However, if you want to specify a different player for playback, specify it in playerId. To enable the set parameters, set the ENABLE_PLAYER_ID bit of the enableFlag.

Sounds are played back using the player priority set in the sound archive, but if you want to specify a different priority value for playback, set playerPriority. To enable the set parameters, set the ENABLE_PLAYER_PRIORITY bit of the enableFlag.

actorPlayerId sets the actor player number to use for playback by the SoundActor class. Takes values in the range of 0 to 3. To enable the set parameters, set the ENABLE_ACTOR_PLAYER_ID bit of the enableFlag. (Under NW4C-0.4.1, currently there is no effect even if this value is set.)

seqSoundInfo holds parameters that relate to sequence sounds. It is only valid when playing sequence sounds. It is possible to overwrite the sequence sound-related information that is set within a sound archive. For details, refer to the SeqSoundInfo structure. To enable the set parameters, set the ENABLE_SEQ_SOUND_INFO bit of the enableFlag.

Structures

nw::snd::SoundStartable::StartInfo::SeqSoundInfo A structure of parameters related to sequence sounds.

Enumerated Types

EnableFlagBit StartInfo Defines bit flags used to enable structure parameters.
StartOffsetType Defines the unit of the sound start offset value.

Member Variables

enableFlag Bit flag for enabling the values set in the structure. With the default value, all are disabled.
startOffsetType Unit of the sound start offset value.
startOffset Sound start offset value.
playerId Player ID used when playing sounds.
playerPriority Player priority set for the sound.
actorPlayerId Actor player number to use for playback with a SoundActor. (Under NW4C-0.4.1, currently there is no effect even if this value is set.)
seqSoundInfo A parameter related to sequence sounds.

Member Functions

StartInfo Constructor.

See Also

SoundStartable::StartSound

Revision History

2010/01/25
Initial version.

CONFIDENTIAL