C4 Engine
C4 Engine API Documentation

Sound::SetSoundProperty

Defined in:  C4Sound.h
Sets a sound property.
Prototype

void SetSoundProperty(int32 property, float value);

Parameters
property The identifier of the property to set.
value The new value of the property.
Description
The SetSoundProperty function sets one of the sound properties listed below.
kSoundVolume The master volume for the sound. All other volumes are relative to this volume. The default value is 1.0.
kSoundDirectVolume The volume applied to the sound's direct path. The default value is 1.0, representing no obstruction.
kSoundDirectHFVolume High-frequency volume applied to the sound's direct path. A value of 1.0 means no high-frequency damping, and 0.0 means maximum damping. The default value is 1.0, representing no obstruction.
kSoundReflectionVolume The volume of reflections (and subsequent reverberation) generated by the sound. The default value is 1.0.
kSoundReflectionHFVolume High-frequency volume applied to reflections generated by the sound. A value of 1.0 means no high-frequency damping, and 0.0 means maximum damping. The default value is 1.0.
kSoundOuterConeVolume The volume of a directional sound outside the outer cone. The default value is 0.0.
kSoundOuterConeHFVolume High-frequency volume applied outside the outer cone. A value of 1.0 means no high-frequency damping, and 0.0 means maximum damping. The default value is 1.0.
kSoundMinAttenDistance The distance below which the sound is unattenuated and plays at full volume. This must be greater than or equal to 0.0. The default value is 0.0.
kSoundMaxAttenDistance The distance above which the sound is completely silent due to attenuation. This must be greater than the value of kSoundMinAttenDistance. The default value is 16.0.
kSoundInnerConeCosine The cosine of the inner sound cone's apex angle. This must be in the range [−1.0, 1.0]. The default value is 1.0.
kSoundOuterConeCosine The cosine of the outer sound cone's apex angle. This must be in the range [−1.0, 1.0]. The default value is 0.0.
kSoundFrequency The relative frequency at which the sound is played. This must be a positive number. A value of 1.0 (the default) means play at the frequency of the source data, a value of 0.5 means play at half the frequency, and so on. Values greater than 1.0 are allowed, but sound quality may be diminished.
Values for volume-related properties are typically in the range [0, 1], but values outside this range are acceptable. The kSoundVolume property is a master volume for the sound, and all other volumes are relative to it. The final volume of a sound is further modified by the master volume set in the Sound Manager (see SoundMgr::SetMasterVolume) and the volume set for the sound's group, if any (see SoundGroup::SetVolume).

The kSoundFrequency property is a multiplier that affects the playback frequency of a sound. A value of 1.0 means that the sound is played back at its native frequency. If the Doppler shift is enabled for a sound (see Sound::SetSoundFlags), then it is applied in addition to the frequency property.

Properties having to do with sound cones are applied only if the kSoundCones flag is set.
See Also

Sound::GetSoundProperty

Sound::GetSoundFlags

Sound::SetSoundFlags

SoundGroup::GetVolume

SoundGroup::SetVolume

SoundMgr::GetMasterVolume

SoundMgr::SetMasterVolume