resonance-audio / resonance-audio-unity-sdk

Resonance Audio SDK for Unity
https://resonance-audio.github.io/resonance-audio/develop/unity/getting-started
Other
297 stars 38 forks source link

Resonance Audio Source position doesn't update after Stop() #36

Open supremevampire opened 6 years ago

supremevampire commented 6 years ago
  1. Set up the project in Unity 2018.1.1f1 as sad in manual.
  2. Place 3 Resonance Audio Sources in scene.
  3. Uncheck "PlayOnAwake" in AudioSource component on one of them.
  4. Place a script on this AudioSource: using UnityEngine; public class Compas : MonoBehaviour { private AudioSource mAudioSRC; void Start() { mAudioSRC = GetComponent(); } void Update() { if (Input.GetButtonDown("Fire1")) mAudioSRC.Play(); else if(Input.GetButtonUp("Fire1")) mAudioSRC.Stop(); } }
  5. Place Standart first person character controller and floor (cube) in scene.
  6. Play the scene, press and release Fire1 (Left mouse).
  7. Rotate camera with mouse. Rotation of camera wil change, but sound positions will be unchanged.
NOT-Lonely commented 6 years ago

Same problem in Unity 2018.2.2.f1

maunsbach commented 5 years ago

Similar issue with 2018. 2.7f1.

As soon as one audio source is done playing, the spatialization stops working for all sources. Easy to test by having one short and one long audio source and "PlayOnAwake". As soon as the short one is finished playing, the spatialization stops working for the long one as sound positions are stuck.

phields commented 5 years ago

Same problem! Need fix!

Niclaswi commented 5 years ago

+1

RodjaAlbus commented 5 years ago

Hi. I discovered that if you put all the audiomixers´ "Update mode" on Unscaled time instead of normal it works.

CrazyOldMaurice commented 5 years ago

So, good news is that we've implemented a fix in 2019.1+. On previous versions the work around will be needed. On a plus side the workaround is fairly simple. On your audio sources be sure to call source.SetSpatialize(false) after the sound is done playing and be sure to call source.SetSpatialize(true) before you play another sound through that audio source. The issue is that the Resonance may get it's audio listener coordinates from a stale audio source. So something like MySpatializedAudioSource.SetSpatialize(false) when it's finished playing a sound.

purplejamltd commented 5 years ago

This issue is not fixed for me, all spatialisation ends up going to the right channel now instead.