Class AudioCache
A class to load, store and retreive UnityEngine.AudioClip
Inherited Members
Namespace: LLBML.Audio
Assembly: LLBModdingLib.dll
Syntax
public class AudioCache : GenericCache<string, AudioAsset>
Properties
IsLoading
Whether or not some loading coroutines are currently running
Declaration
public bool IsLoading { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
Add(String, AudioAsset)
Adds the specified key and asset.
Declaration
public override void Add(string key, AudioAsset audioAsset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key to insert into. |
| AudioAsset | audioAsset | The AudioAsset to insert. |
Overrides
Add(String, AudioClip)
Adds the specified key and clip.
Declaration
public void Add(string key, AudioClip audioClip)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key to insert. |
| UnityEngine.AudioClip | audioClip | The UnityEngine.AudioClip. |
CLoadClip(String, AudioInfo)
Coroutine that loads an audio file and stores it into the cache
Declaration
public IEnumerator CLoadClip(string key, AudioInfo audioInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The index for the audio clip |
| AudioInfo | audioInfo | The AudioInfo to load |
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator |
GetAsset(String)
Gets the first AudioAsset that is found with the specified key.
Declaration
public AudioAsset GetAsset(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The list index |
Returns
| Type | Description |
|---|---|
| AudioAsset |
GetAssets(String)
Gets the System.Collections.Generic.List<T> with the specified key.
Declaration
public List<AudioAsset> GetAssets(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | Key. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<AudioAsset> |
GetClip(String)
Gets the first clip that is found under the assets with the specified key.
Declaration
public AudioClip GetClip(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The list index |
Returns
| Type | Description |
|---|---|
| UnityEngine.AudioClip |
GetClips(String)
Gets a list of UnityEngine.AudioClip under the assets with the specified key.
Declaration
public List<AudioClip> GetClips(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The list index |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<UnityEngine.AudioClip> |
LoadClip(String, AudioInfo)
Loads the audio file described by the AudioInfo into a clip, then store it into the cache at the specified index.
Declaration
public void LoadClip(string key, AudioInfo audioInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The index of the resulting clip |
| AudioInfo | audioInfo | The AudioInfo of the audio file to load. |
LoadClip(String, FileInfo, String)
Loads the audio file, into a clip, then store it into the cache at the specified index.
Declaration
public void LoadClip(string key, FileInfo file, string clipName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The index of the resulting clip |
| System.IO.FileInfo | file | The path to the audio file to load. |
| System.String | clipName | The name the resulting clip should have. |
LoadClip(String, String, String)
Loads the audio file, into a clip, then store it into the cache at the specified index.
Declaration
public void LoadClip(string key, string filePath, string clipName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The index of the resulting clip |
| System.String | filePath | The path to the audio file to load. |
| System.String | clipName | The name the resulting clip should have. |