Jump to content
  • Advertisement
Sign in to follow this  
Konk

OpenAL: Volume stays despite greater distance - no falloff

This topic is 5411 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everybody! I have an issue about OpenAL: A sound source is moving away from the listener - and initially you can hear how it's getting less intense. But then the volume stays at a certain level, although it is still moving away and should get quieter. I tried all DisctanceModels, some AL_MAX_DISTANCEs, AL_REFERENCE_DISTANCEs, AL_MIN_GAIN and so on, but the output is always the same! (even alDistanceModel(AL_NONE) doesn't affect the sound output in any way; shouldn't there be no decrease at all when I use this?) I hope somebody has an idea what I might have forgotten. The sample code for the initialization is: // for the Soundsource: //.. alSourcef (Source, AL_PITCH, 1.0f ); alSourcef (Source, AL_GAIN, 1.0f ); alSourcefv(Source, AL_POSITION, SourcePos); alSourcefv(Source, AL_VELOCITY, SourceVel); alSourcei (Source, AL_LOOPING, AL_TRUE ); alDistanceModel(AL_INVERSE_DISTANCE_CLAMPED); alSourcef (Source, AL_MAX_DISTANCE, 2.0f); alSourcef (Source, AL_REFERENCE_DISTANCE, 1.0f); ... //and for the listener I tried: alListenerf (AL_ROLLOFF_FACTOR, 01.05f);

Share this post


Link to post
Share on other sites
Advertisement
Ok, I found the mistake myself - when setting the AL_REFERENCE_DISTANCE value, sound isn't attenuated below this distance.
When not setting any of the flags at all (and so everything is on default value) it works just fine...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!