Unity 5 Audiomixer and AudioMixerSnapshots problem on ios

Hi,

I’am trying to use audiomixer snapshots in my app for iPad , but I have hard time to making it work. It works perfect in the editor but doesn’t work on iPad device. I am getting null exception on iPad.

Short piece of code :

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Audio;

public class QuickMenu : MonoBehaviour {
public AudioMixerSnapshot normal;
public AudioMixerSnapshot pause;

public void OnPause()
{
pause.TransitionTo(0.1f);
}
public void OnResume()
{
normal.TransitionTo(0.1f);
}
}

As I said before I am getting null exception on iPad once when I call OnPause() method , but it works in editor. Any idea ? Thanks in advance.

More details would help. Is it the AudioMixerSnapshot pause object that’s null? In that case, is “normal” null too on iOS? How are you are assigning to these fields, code ore drag and drop? Etc…

Hi, thanks for reply ,

I have made snapshot in editor and I have a assigned them to those fields in editor by drag and drop . Yes on the iPad I have receive null exception for normal and pause variable.

By the way , how I can assign those field from script any idea ?

Thanks

Haven’t explored snapshots much yet, but that looks like a bug. Check for null in Awake, see what happens… If the AudioMixerSnapshot objects you assigned in the inspector magically disappear when running on the device, then yeah, it’s a bug. Just try a standalone build to be sure it’s device specific.

Thanks, I will check that and I will post results :smile:

@AnimosusIII , any luck on this issue?

Actually I made work around , I didn’t use mixer for script manipulation only for static editor audio configurations , but I have to check again with new version of Unity 5 :smile:.

I´m having the same problems with the latest Unity version. My audio mixers setup only works in editor. And we have the game ready for the store :frowning:

Vote here and maybe we’ll get a quick fix:
http://issuetracker.unity3d.com/issues/il2cpp-audiomixer-dot-findmatchinggroups-returns-null