Jump to content

  • Log In with Google      Sign In   
  • Create Account


OpenAL distance scaling


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 DrWhatsisname   Members   -  Reputation: 109

Like
0Likes
Like

Posted 19 May 2013 - 04:36 PM

I am working on a project in lwjgl which uses OpenAL for its audio. The library seems to be primarily built for 3D sound, but I am attempting to use it in a 2D game. I'm having an issue where OpenAL seems to be interpreting the distances and velocities that I give as much larger than they need to be.

j2g3nDW.png

The picture above is a screen shot from the game. Its a top-down shooter and the enemies really aren't that far away. I'm playing a firing sound from the location of each of the enemies you see on screen whenever they fire a shot, but when they do, it is essentially inaudible. If I turn up the volume and move towards or away from the enemies as they fire, the pitch of the sound will bend (due to the Doppler shift) outside of the audible range, or potentially the frequency range of my speakers.

 

I have tried explicitly setting the AL_REFERENCE_DISTANCE and AL_MAX_DISTANCE values to 1.0f and the max value of a float respectively which does nothing presumably since these are the default values. The  problem could potentially have to do with the fact that my coordinates are in terms of pixels, so the enemies on screen are some 250 units away and the player is moving at 240 units per second. Is this a cause of the problem? How can I fix it?



Sponsor:

#2 Khatharr   Crossbones+   -  Reputation: 2818

Like
0Likes
Like

Posted 19 May 2013 - 10:57 PM

Which distance model are you using and what is AL_ROLLOFF_FACTOR set to?
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS