OpenAL Doppler Effect

Started by
-1 comments, last by SgtMaster 18 years, 10 months ago
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.

This topic is closed to new replies.

Advertisement