private void OnClipLoaded(AudioClip audioClip) { customAudioCase = AudioController.GetCustomSource(false, audioType); customAudioCase.source.clip = audioClip; }
public NativeAudioCase(string fileName, AudioController.AudioType type) { audioName = fileName; audioType = type; #if UNITY_EDITOR AudioController.LoadAudioClipFromStreamingAssets(fileName, OnClipLoaded); #elif UNITY_ANDROID float currentVolume = type == AudioController.AudioType.Sound ? AudioController.GetSoundVolume() : AudioController.GetMusicVolume(); //var adjustment = new NativeAudio.PlayAdjustment { volume = currentVolume, pan = 1f }; //playOptions = new NativeAudio.PlayOptions { playAdjustment = adjustment }; //Debug.Log("Created native audio case for:" + fileName + " volume: " + currentVolume); audioEnabled = currentVolume == 0 ? false : true; nativeAudioPointer = NativeAudio.Load(fileName); #endif }