Sound::set3DMinMaxDistance

FMOD Studio API

Firelight Technologies FMOD Studio API

Sound::set3DMinMaxDistance

Sets the minimum and maximum audible distance for a sound.

MinDistance is the minimum distance that the sound emitter will cease to continue growing louder at (as it approaches the listener).
Within the mindistance it stays at the constant loudest volume possible. Outside of this mindistance it begins to attenuate.
MaxDistance is the distance a sound stops attenuating at. Beyond this point it will stay at the volume it would be at maxdistance units from the listener and will not attenuate any more.
MinDistance is useful to give the impression that the sound is loud or soft in 3D space. An example of this is a small quiet object, such as a bumblebee, which you could set a mindistance of to 0.1 for example, which would cause it to attenuate quickly and dissapear when only a few meters away from the listener.
Another example is a jumbo jet, which you could set to a mindistance of 100.0, which would keep the sound volume at max until the listener was 100 meters away, then it would be hundreds of meters more before it would fade out.

In summary, increase the mindistance of a sound to make it 'louder' in a 3D world, and decrease it to make it 'quieter' in a 3D world.
Maxdistance is effectively obsolete unless you need the sound to stop fading out at a certain point. Do not adjust this from the default if you dont need to.
Some people have the confusion that maxdistance is the point the sound will fade out to, this is not the case.

C++ Syntax

FMOD_RESULT Sound::set3DMinMaxDistance(
  float min,
  float max
);

C Syntax

FMOD_RESULT FMOD_Sound_Set3DMinMaxDistance(
  FMOD_SOUND *sound,
  float min,
  float max
);

C# Syntax

RESULT Sound.set3DMinMaxDistance(
  float min,
  float max
);

JavaScript Syntax

Sound.set3DMinMaxDistance(
  min,                             
  max                              
);

Parameters

min
The sound's minimum volume distance in "units". See remarks for more on units.
max
The sound's maximum volume distance in "units". See remarks for more on units.

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

A 'distance unit' is specified by System::set3DSettings. By default this is set to meters which is a distance scale of 1.0.
See System::set3DSettings for more on this.
The default units for minimum and maximum distances are 1.0 and 10,000.0f.

See Also




Version 1.10.03 Built on Feb 1, 2018