Channel::setVolume

FMOD Studio API

Firelight Technologies FMOD Studio API

Channel::setVolume

Sets the volume level linearly.

C++ Syntax

FMOD_RESULT Channel::setVolume(
  float volume
);

C Syntax

FMOD_RESULT FMOD_Channel_SetVolume(
  FMOD_CHANNEL *channel,
  float volume
);

C# Syntax

RESULT Channel.setVolume(
  float volume
);

JavaScript Syntax

Channel.setVolume(
  volume                           
);

Parameters

volume
Linear volume level, default = 1.0.

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

Volume level can be below 0 to invert a signal and above 1 to amplify the signal. Note that increasing the signal level too far may cause audible distortion.

Sound::setDefaults can be used to change the default volume for any channels played using that sound.

See Also




Version 1.10.03 Built on Feb 1, 2018