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

Another not working in 2017.3 (and latest patch) post #18

Closed PercyPea2 closed 6 years ago

PercyPea2 commented 6 years ago

Hi all,

I'm using 1.1.1.

Although at first glance spatial audio works if you have a gameobject with a looping audioclip on an Audio Source (ie the default cube scene). If you actually via script set what clip that audio source should play, it doesn't work when built for Android (DayDream)

From LogCat I can see 'E/Unity: Audio effect Resonance Audio Renderer could not be found. Check that the project contains the correct native audio plugin libraries and that the importer settings are set up correctly.'

The same project built in 2017.1 works fine (and doesn't show that error).

I'm using the simple cube demo scene, and removing the default sound from playing, and instead adding this script to the cube to just cycle through random sounds (sounds populated in Inspector). :- using System.Collections; using System.Collections.Generic; using UnityEngine.Audio; using UnityEngine;

public class RandomSound : MonoBehaviour {

public AudioClip[] sounds;
int count = 0;
void Update () {
    count++;
    if (count > 100) {
        count -= 100;
        GetComponent<AudioSource> ().clip = sounds [Random.Range (0, sounds.Length)];
        GetComponent<AudioSource> ().Play ();
    }
}

}

I will also report this bug to Unity as i'm guessing it's primarily their issue seeing as 2017.1 works (I've not yet tried 2017.2)

Thanks

mgorzel commented 6 years ago

Thanks @PercyPea2 for reporting that - we will have a look and get back to you soon!

PercyPea2 commented 6 years ago

Did a bit more digging. Unity's 2018 beta also has the issue, but 2017.2 (non patch release) doesn't. So as anokta said here :-https://github.com/resonance-audio/resonance-audio-unity-sdk/issues/14

Seems to be a bug unity introduced.

anokta commented 6 years ago

Hi,

As you've already figured it out from #14, Unity introduced a bug in 2017.2.1 (and above) that affects, AFAIK, all the third-party audio plugins on Android. We have already contacted with Unity, and it is said to be fixed with a public patch very soon.

Will update the issue #14, once the fix is available by Unity.

anokta commented 6 years ago

Duplicate of #14