Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Idle / stopped sounds cause audio listener rotation to stop working #55

Open
bcjordan opened this issue Feb 9, 2019 · 8 comments
Open

Comments

@bcjordan
Copy link

bcjordan commented Feb 9, 2019

If I have an AudioSource which I call Play() on:

image

image

After it finishes playing, the Resonance scene stops updating the positions of the other items in the scene.

If I enable looping, the problem doesn't happen.

Any ideas?

@bcjordan bcjordan changed the title Non-looping sounds cause audio listener rotation to stop working Idle / stopped sounds cause audio listener rotation to stop working Feb 9, 2019
@bcjordan
Copy link
Author

bcjordan commented Feb 9, 2019

@bcjordan
Copy link
Author

bcjordan commented Feb 9, 2019

Workaround that somehow works:

using UnityEngine;

public class ToggleAfterDonePlaying : MonoBehaviour
{
	private AudioSource _audioSource;
	private bool _needsToReset;

	private void Start()
	{
		_audioSource = GetComponent<AudioSource>();
	}

	void Update()
	{
		if (_audioSource.isPlaying)
		{
			_needsToReset = true;
		}
		else
		{
			if (_needsToReset)
			{
				gameObject.SetActive(false);
				gameObject.SetActive(true);
				_needsToReset = false;
			}
		}
	}
}

@bcjordan
Copy link
Author

bcjordan commented Mar 1, 2019

Another user confirmed this fix approach is both required and works.

Wonder what the underlying issue is?

@bonickhausen
Copy link

So, any ETA for a fix?

I'm considering not using Resonance because of this issue.

@CrazyOldMaurice
Copy link

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
Copy link

This hasn't been fixed for me. Still getting spatialisation stopping.

@taridyn
Copy link

taridyn commented Jul 29, 2019

I think I ran into this problem as well. I figured it would help the Developers to get a clean example of the problem, so I made a simple unity scene which shows the problem with as little complication as possible:

https://drive.google.com/open?id=1NstEdtPWj6D7iNm8J8oDXQF1m3Dv9Gzy

I also made some videos showing the problem:

https://www.youtube.com/watch?v=ta1S7yTfsVA&feature=youtu.be
https://www.youtube.com/watch?v=e7jJpK_HN0U&feature=youtu.be

Follow up: Found answer on other thread. Upgraded to 2019.1.12, it seems to have fixed the problem. I guess I will just leave this here for reference if the Devs need an example of it or something.

@PhilippFors
Copy link

Hello, this issue is still present for me on Unity version 2019.2.12f1 and can only be fixed by resetting every audio source in the scene.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants