Class SoundManager
Class for managing loading and caching of AudioClips from wav files.
Assembly: ItemChanger.dll
Syntax
public class SoundManager
Constructors
View Source
SoundManager(Assembly, string)
Creates a SoundManager to lazily load and cache AudioClips from the embedded wav files in the specified assembly.
Only filepaths with the matching prefix are considered, and the prefix is removed to determine clip names (e.g. "ItemChanger.Resources.Audio." is the prefix for Instance).
Declaration
public SoundManager(Assembly a, string resourcePrefix)
Parameters
Fields
View Source
actors
The Actors AudioMixerGroup, from global resources. Used as the mixer for SoundManager.PlayClipAtPoint.
Declaration
public static readonly AudioMixerGroup actors
Field Value
Properties
View Source
Instance
The SoundManager with access to embedded ItemChanger wavs.
Declaration
public static SoundManager Instance { get; }
Property Value
Methods
View Source
FromStream(Stream, string)
Convert the stream representing a 16-bit uncompressed .WAV file to an AudioClip.
Declaration
public static AudioClip FromStream(Stream s, string name)
Parameters
Returns
View Source
GetAudioClip(string)
Fetches the AudioClip with the specified name. If it has not yet been loaded, loads it from embedded resources and caches the result.
Declaration
public AudioClip GetAudioClip(string name)
Parameters
| Type |
Name |
Description |
| string |
name |
|
Returns
View Source
PlayClipAtPoint(string, Vector3)
Equivalent to the static PlayClipAtPoint, composed with GetAudioClip.
Declaration
public void PlayClipAtPoint(string name, Vector3 pos)
Parameters
View Source
PlayClipAtPoint(AudioClip, Vector3)
Creates an AudioSource component at the specified point with generally applicable settings, and plays the clip from that source.
Declaration
public static void PlayClipAtPoint(AudioClip clip, Vector3 pos)
Parameters
View Source
SaveAs(AudioClip, string)
Save the uncompressed 16-bit audio clip as a .WAV file.
Declaration
public static void SaveAs(AudioClip clip, string fileName)
Parameters
Extension Methods