I want my sound volume to drop to zero after some time. I’ve tried to increase rolloff factor (distance factor is 1.0, as it should be) and it works (sound fades faster), but no matter how far I go from sound source, it is still there (although faint).
Is there an global options setting minimal sound volume? (I would say no)
How do I properly use FMOD_3D_LINEARROLLOFF? Do I have to set it before or after call to playSound() (using C++ interface)?
To my understanding, when using linear rolloff min distance is distance where linear attenuation starts, and max distance where it stops (i.e. volume is 0).
However, I wasn’t ablo to achieve this (sound doesn’t chage at all). It does change properly when using LOGROLLOFF (but does not go to zero, as mentioned before).
- igorl asked 12 years ago
After setting min/max distance for channel, it somwhow works. It still does not go compleatelly silent (i.e. if I move 10000 units and max distance is set to 20 units, I can still hear it, its faint but can be heard). This is the only sound.
channel->getMode(&mode); (mode & FMOD_3D_LINEARROLLOFF) is true.
channel->get3DMinMaxDistance returns valid distances (as set before).
Where should I look next?
This is WinXP with Nvidia soundstorm if that matters. FMOD Ex is the last version (downloaded few days ago). MS VC.NET 2003 (VC7.1).
i’ve just tested this with all cases presented above, using the 3d example.
- 2.0 to 5.0 works as it should be, being full at 2.0 and silent at 5.0+. I tested with soundcard volume at full, using high quality headphones. No sound was heard outside of 5.0 range.
- hardware or software don’t matter.
- getAudibility gives the right values.
Changes i made
result = system->createSound("../media/drumloop.wav", FMOD_HARDWARE | FMOD_3D_LINEARROLLOFF | FMOD_3D, 0, &sound1);
result = sound1->set3DMinMaxDistance(2.0f * DISTANCEFACTOR, 5.0f * DISTANCEFACTOR);
result = system->createSound("../media/drumloop.wav", FMOD_SOFTWARE | FMOD_3D_LINEARROLLOFF | FMOD_3D, 0, &sound2);
result = sound2->set3DMinMaxDistance(2.0f * DISTANCEFACTOR, 5.0f * DISTANCEFACTOR);
// print out a small visual display
float aud1, aud2;
channel1->getAudibility(&aud1); channel2->getAudibility(&aud2); sprintf(s, "|.......................<1>......................<2>....................|%.1f %.1f", aud1, aud2);
I’ve just tested the same thing with 3D example.
set max distance to 5.0f * DISTANCEFACTOR (instead of 10000.0f *…).
Add | FMOD_3D_LINEARROLLOFF to createSound mode.
Now, when moving left/right using <>, sounds are still being heard (faintly) event if outside of 5 distance.
[quote="andrew":2j4vyrrn]Hi Tony, check the docs on Channel::set3DMinMaxDistance. A maxdistance of 4 means that your sound never gets a chance to attenuate.
Cheers,[/quote:2j4vyrrn]Why? I have the same problem and i didn’t find that information in the documentation :S (using the .27 api)
Thanks in advance
If i’m not wrong the min and max parameters using linear atenuation defines the point where atenuation starts and the point where atenuation stops and no sound is there when you pass this point.
But…? is there any limitation in min/max parameters?
Please login first to submit.