Previous Topic Index Next Topic
[API function]

FSOUND_Sample_SetMinMaxDistance

Sets the minimum and maximum audible distance for a sample.
MinDistance is the minimum distance that the sound emitter will cease to continue growing
louder at, regardless of how close it is (beyond that point).
This is useful to give the impression that the sound is very loud or soft. An example of
this is taken from the DirectSound3D documentation.
Take a bee and a jet engine, Their original sampledata is recorded to fit into 16bits, and
therefore could have the same volume, but making a jets minimum distance 100 meters would
keep it loud for 100 meters, and then drop off, but if the bees minimum distance was 2cm it
would start to drop off almost immediately, and depending on its maximum distance, fade out
altogether.
-------
MaxDistance is the distance a sound stops getting quieter at. This does not affect how fast
the volume drops off, and should not be changed unless nescessary. It is only available for
completeness, it is really an obsolete value in most situations.
-------
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.

signed char F_API FSOUND_Sample_SetMinMaxDistance(
FSOUND_SAMPLE *sptr,
float min,
float max
);

Parameters

sptr The sample to have its minimum and maximum distance set.
min The sample
s minimum volume distance in units
. See remarks for more on units. max
The sample s maximum volume distance in
units . See remarks for more on units.

Return Value

On success, TRUE is returned.
On failure, FALSE is returned.

Remarks

A 'distance unit' is specified by FSOUND_3D_Listener_SetDistanceFactor. By default this is
set to meters which is a distance scale of 1.0. See FSOUND_3D_Listener_SetDistanceFactor
for more on this.
-------
The default units for minimum and maximum distances are 1.0 and 1000000000.0f
Volume drops off at mindistance / distance.

See Also

FSOUND_3D_GetAttributes , FSOUND_3D_Listener_SetDistanceFactor , FSOUND_3D_SetAttributes

This document copyright ©Firelight Multimedia, 1999-2001. All rights reserved.
Generated Thu Sep 13 00:18:09 2001 by SourceDoc v0.10, the automated source code documenter.