Implementing Doppler Effect in C++

Nov 22, 2018 at 5:45pm
Need to make a project and don't know where to start
Nov 22, 2018 at 5:58pm
closed account (E0p9LyTq)
http://bfy.tw/Kzh4
Nov 22, 2018 at 6:28pm
...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.
Nov 22, 2018 at 7:39pm
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.
Nov 23, 2018 at 4:17pm
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...
Nov 23, 2018 at 10:56pm
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 Nov 23, 2018 at 10:58pm
Topic archived. No new replies allowed.