Advertisement Jump to content
Sign in to follow this  

OpenAL Doppler Effect

This topic is 4972 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

Hi, I have been programming a 3D sound with OpenAL, but encountered a problem with doppler effect that I cannot seem to solve. Could I please borrow your wisdom? Here it goes. I currently have a 3D world where the listener is set where the camera is (first person view). The orientation of the listener is calculated from the direction the camera is facing. Velocity of the listener is currently set to 0. Lets say I fire a rocket with at direction D with some scalar velocity. The program creates a source with rocket flying sound positioned initially at the camera, with direction D and velocity calculated by multiplying scalar factor to direction D. The position of the source is constantly updated, so in my logic, this should produce a sound moving away from the listener, flying towards the direction specified by D at some constant speed. So this should make the sound pitch lower as the sound is moving away, and the pitch shouldn't change no matter which way I am firing. However, the pitch does change depending on the direction I am firing, and the direction I am facing. So, if I fire in one direction, and if I immediately rotate my camera (change the orientation of the listener), the pitch changes. Any idea on why this might be happening? Am I misinterpreting the source velocity? Why does listener orientation take a roll in doppler effects? Thank you for reading, and any response is greatly appreciated.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!