ChannelControl::addFadePoint

FMOD Studio API

Firelight Technologies FMOD Studio API

ChannelControl::addFadePoint

Add a volume point to fade from or towards, using a clock offset and 0 to 1 volume level.

C++ Syntax

FMOD_RESULT ChannelControl::addFadePoint(
  unsigned long long dspclock,
  float volume
);

Parameters

dspclock

DSP clock of the parent channel group to set the fade point volume.

volume

Volume level where 0 is silent and 1.0 is normal volume. Amplification is supported.

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

For every fade point, FMOD will do a per sample volume ramp between them. It will scale with the current Channel or ChannelGroup's volume.

// Ramp from full volume to half volume over the next 4096 samples
FMOD_RESULT result;
unsigned long long parentclock;
result = target->getDSPClock(NULL, &parentclock);
result = target->addFadePoint(parentclock,        1.0f);
result = target->addFadePoint(parentclock + 4096, 0.5f);

See Also




Version 1.10.03 Built on Feb 1, 2018