Implementing Doppler Effect in C++

Need to make a project and don't know where to start
closed account (E0p9LyTq)
http://bfy.tw/Kzh4
...don't know where to start

Maybe going to university and study software-development.
Sorry, just joking.

If you don't have the necessary skills you could go to the job section.
http://www.cplusplus.com/forum/jobs/
There are people here who might do it for you if you offer some payment.
OpenAL Soft (not to be confused with OpenAL, a closed source library by Creative) implements Doppler for moving sound sources, using a speed_of_sound parameter as input and using the change in position of the along time to determine its speed and relative direction.
Not sure why I'm even bothering replying to such a vague OP, but you could start by just translating the equations in the General section of the Wikipedia article to C++.
https://en.wikipedia.org/wiki/Doppler_effect#General
Test input, test output. If you want more help, be more specific of what you're trying to accomplish...
you need to get an audio library, figure out how the stereo part works to send the sound to the left or right speaker (probably by percentage, but I don't know) and then iterate sending your sound to it changing the balance over time to make it fade in and out. Or, more likely, you would just record the sound with that effect using a tool and then play back the sound file from your program; this is much easier where it is possible. Its not always possible if the scene where the sound is generated is user controlled/affected.


Last edited on
Topic archived. No new replies allowed.