nw::snd::StreamSoundHandle::SetTrackVolume Member Function

Syntax

#include <nw/snd/snd_StreamSoundHandle.h>
void SetTrackVolume(
     u32 trackBitFlag,
     f32 volume,
     int frames = 0
);

Arguments

Name Description
in trackBitFlag Bit flag for each track.
in volume Volume change ratio.
in frames Number of frames used for volume change. The number of frames is based on the number of calls to SoundArchivePlayer::Update.

Return Values

None.

Description

Changes the volume of streaming sound tracks.

Changes the volume of streaming tracks in the sound associated with the handle. If the handle is invalid, the function does nothing.

The value specified by this function operates independently of other volume parameters, which are mixed together.

The trackBitFlag argument specifies the track. Tracks are identified from the lower bit in sequence; for example, Track 0, Track 1, Track 2 and so on. The silent status will change for all tracks with enabled bits. For example, to change the silent status of Track 2 and Track 5, use (1 << 2) | (1 << 5); i.e., 0x0024.

The volume argument specifies a ratio of 0.0 or greater. There is no effect on the volume if 1.0 is specified. If 0.0 is specified, no sound is output. The default value is 1.0.

Note: After being combined with the other volume parameters, the final volume is clamped to the range of 0.0 to 2.0. Twice the original volume may not result even if a value of 2.0 is set with this function.

Revision History

2010/12/24
Added information about the number of frames.
2010/01/22
Initial version.

CONFIDENTIAL