# Doppler Effect Missing / Set Up Incorrectly

**URL:** <https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351>\
**Category:** Unity\
**Created:** [March 24, 2014, 7:04am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351 "2014-03-24T07:04:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![enemystarfighter](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@enemystarfighter](https://qa.fmod.com/u/enemystarfighter)\
**Post date:** [March 24, 2014, 7:04am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/1 "2014-03-24T07:04:41Z")

</div>

Hi!

I’ve successfully integrated your project into mine, can trigger events, and am properly setting the velocities in the attributes structs for the listener and the sources. But I cannot for the life of me hear any doppler working, or find a setting in Studio that lets me add that effect. I see settings for it in your Designer EX editor, is this possible in Studio?

Am I setting this up wrong in Studio somewhere? I also notice I can’t access System::set3DSettings() in the Unity scripts.

Thanks!

Edit: I should be clear – the sounds play and attenuate in 3D as they should (or at least it sounds like it), I can walk up to them and hear them get louder, etc.

Edit Again: I’ve now tested this with relative velocities (between listener and source) from 50m/sec to 2000m/sec and there is no audible difference.

---

<div class="post-metadata">

**Author:** ![Kidbassmusic](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@Kidbassmusic](https://qa.fmod.com/u/Kidbassmusic)\
**Post date:** [May 6, 2014, 2:08pm UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/2 "2014-05-06T14:08:18Z")

</div>

Hey guys I am also very interested in this. We are currently trying to implement doppler with the code shown above. But please PM or email me, when this is due to be implemented within Studio.  
thank you

---

<div class="post-metadata">

**Author:** ![atomtwist](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@atomtwist](https://qa.fmod.com/u/atomtwist)\
**Post date:** [April 26, 2014, 9:49am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/3 "2014-04-26T09:49:02Z")

</div>

thx peter. works fine.

You also have to change `
static FMOD_Listener sListener = null;
`  
to `
public static FMOD_Listener sListener = null;
`  
in the FMOD\_Listener class, for this to work.

---

<div class="post-metadata">

**Author:** ![enemystarfighter](https://avatars.discourse-cdn.com/v4/letter/e/958977/32.png) [@enemystarfighter](https://qa.fmod.com/u/enemystarfighter)\
**Post date:** [April 30, 2014, 3:47pm UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/4 "2014-04-30T15:47:43Z")

</div>

Awesome, thank you!

---

<div class="post-metadata">

**Author:** ![atomtwist](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@atomtwist](https://qa.fmod.com/u/atomtwist)\
**Post date:** [April 18, 2014, 5:41pm UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/5 "2014-04-18T17:41:06Z")

</div>

bump…  
any info regarding the doppler?

---

<div class="post-metadata">

**Author:** ![DanjelRicci](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/danjelricci/32/23_2.png) [@DanjelRicci](https://qa.fmod.com/u/DanjelRicci)\
**Post date:** [April 19, 2014, 11:06am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/6 "2014-04-19T11:06:34Z")

</div>

I’m in the same situation, the doppler effect seems completely missing even after assigning position and velocity to audio sources. ☹

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [April 22, 2014, 12:25am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/7 "2014-04-22T00:25:43Z")

</div>

Hi Guys,

Yes, doppler isn’t currently implemented in Studio. It is a high priority feature and it’s on our backlog, I will let you know when we have scheduled it. In the mean time if you’re need doppler immediately you can implement in Unity like this:

```auto
const float SPEED_OF_SOUND = 340.0f;
var directionOfListener = (transform.position - FMOD_Listener.sListener.transform.position).normalized;
var speedRelativeToListener = speed * Vector3.Dot(transform.forward, directionOfListener);
var dopplerPitch = (SPEED_OF_SOUND - speedRelativeToListener) / SPEED_OF_SOUND;

eventInstance.setPitch(dopplerPitch);
```

---

<div class="post-metadata">

**Author:** ![SteveTack](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@SteveTack](https://qa.fmod.com/u/SteveTack)\
**Post date:** [April 29, 2015, 4:57am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/8 "2015-04-29T04:57:44Z")

</div>

> [@](#):
>
> Hi Guys,
> 
> Yes, doppler isn’t currently implemented in Studio. It is a high priority feature and it’s on our backlog, I will let you know when we have scheduled it. In the mean time if you’re need doppler immediately you can implement in Unity like this:
> 
> ```auto
> const float SPEED_OF_SOUND = 340.0f;
> var directionOfListener = (transform.position - FMOD_Listener.sListener.transform.position).normalized;
> var speedRelativeToListener = speed * Vector3.Dot(transform.forward, directionOfListener);
> var dopplerPitch = (SPEED_OF_SOUND - speedRelativeToListener) / SPEED_OF_SOUND;
> 
> eventInstance.setPitch(dopplerPitch);
> ```

Is this still necessary? The comment from over a year ago was that Doppler wasn’t implemented in Studio, but the current version of FMOD Studio does have a Doppler button and scale knob in the Event Macros section.

Should there be anything else needed when using the Unity integration? I’m OK with the default values for units and speed of sound, etc. In the cases where I do have the Doppler button turned on, in Unity, those events are assigned to “FMOD\_Studio Event Emitter” components attached to the appropriate GameObjects. That would be equivalent to an AudioSource in the built-in Unity audio (no coding is required to get Doppler with that).

---

<div class="post-metadata">

**Author:** ![atomtwist](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@atomtwist](https://qa.fmod.com/u/atomtwist)\
**Post date:** [March 25, 2014, 9:19am UTC](https://qa.fmod.com/t/doppler-effect-missing-set-up-incorrectly/11351/9 "2014-03-25T09:19:52Z")

</div>

I was also wondering about that.  
Cannot hear any doppler effect with FMOD events in Unity.
