using System.Collections.Generic; using UnityEngine; using UnityEngine.Audio; namespace AlicizaX.Audio.Runtime { public interface IAudioService : IService { float Volume { get; set; } bool Enable { get; set; } AudioMixer AudioMixer { get; } Transform InstanceRoot { get; } Transform ListenerTransform { get; } void Initialize(AudioGroupConfig[] audioGroupConfigs, Transform instanceRoot = null, AudioMixer audioMixer = null); void Restart(); float GetCategoryVolume(AudioType type); void SetCategoryVolume(AudioType type, float value); bool GetCategoryEnable(AudioType type); void SetCategoryEnable(AudioType type, bool value); void RegisterListener(AudioListener listener); void UnregisterListener(AudioListener listener); ulong Play(AudioType type, string path, bool loop = false, float volume = 1f, bool async = false, bool cacheClip = true); ulong Play(AudioType type, AudioClip clip, bool loop = false, float volume = 1f); ulong Play3D(AudioType type, string path, in Vector3 position, bool loop = false, float volume = 1f, bool async = false, bool cacheClip = true); ulong Play3D(AudioType type, string path, in Vector3 position, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spatialBlend = 1f, bool loop = false, float volume = 1f, bool async = false, bool cacheClip = true); ulong Play3D(AudioType type, AudioClip clip, in Vector3 position, bool loop = false, float volume = 1f); ulong Play3D(AudioType type, AudioClip clip, in Vector3 position, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spatialBlend = 1f, bool loop = false, float volume = 1f); ulong PlayFollow(AudioType type, string path, Transform target, in Vector3 localOffset, bool loop = false, float volume = 1f, bool async = false, bool cacheClip = true); ulong PlayFollow(AudioType type, string path, Transform target, in Vector3 localOffset, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spatialBlend = 1f, bool loop = false, float volume = 1f, bool async = false, bool cacheClip = true); ulong PlayFollow(AudioType type, AudioClip clip, Transform target, in Vector3 localOffset, bool loop = false, float volume = 1f); ulong PlayFollow(AudioType type, AudioClip clip, Transform target, in Vector3 localOffset, float minDistance, float maxDistance, AudioRolloffMode rolloffMode, float spatialBlend = 1f, bool loop = false, float volume = 1f); bool Stop(ulong handle, bool fadeout = false); bool IsPlaying(ulong handle); void Stop(AudioType type, bool fadeout); void StopAll(bool fadeout); void Pause(ulong handle); void Resume(ulong handle); void Preload(IList paths, bool pin = true); void Unload(IList paths); void ClearCache(); } }