7

I want to control the way how the sound source volume fades out by distance, how can i do this?

Edit: I would also like to know how to scale the sound coordinate system accordingly: i dont want to hear some sound VERY far away from the source: now i would have to change my rendering code to scale coordinates to make it work as i want.

Edit2: Although, one solution could be to multiply my coordinates before i send them... but are there more elegant ways?

Rookie
  • 1,242
  • 3
  • 17
  • 22

1 Answers1

4

That'll be alDistanceModel(AL_LINEAR_DISTANCE) or better alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED), which will turn distant sources off entirely.

Read chapters 3.4.3 and 3.4.4 here. You also have to set the parameters in the formulas listed there (AL_MAX_DISTANCE and AL_REFERENCE_DISTANCE) for each source (alSourcef).

If the parameters don't make sense, attenuation is turned off. If the sound is stereo, likewise (stereo is just that... stereo -- only mono sounds are 3D).

Damon
  • 67,688
  • 20
  • 135
  • 185