AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HoloToolkit.Unity.UAudioManager Class Reference

The UAudioManager class is a singleton that provides organization and control of an application's AudioEvents. Designers and coders can share the names of the AudioEvents to enable rapid iteration on the application's sound similar to how XAML is used for user interfaces. More...

Inheritance diagram for HoloToolkit.Unity.UAudioManager:
HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >

Public Member Functions

void PlayEvent (string eventName)
 Plays an AudioEvent. More...
 
void PlayEvent (string eventName, GameObject emitter, string messageOnAudioEnd=null)
 Plays an AudioEvent. More...
 
void PlayEvent (string eventName, AudioSource primarySource, AudioSource secondarySource=null)
 Plays an AudioEvent. More...
 
void StopEventsOnGameObject (string eventName, GameObject gameObjectToStop, float fadeOutTime=0f)
 Stop event by gameObject. More...
 
void StopAllEvents (string eventName, GameObject emitter=null, float fadeOutTime=0f)
 Stops all events by name. More...
 
void StopAll (GameObject emitter=null, float fadeOutTime=0f)
 Stops all. More...
 
void StopEvent (string eventName, GameObject emitter=null, float fadeOutTime=0f)
 Stops an AudioEvent. More...
 
void SetPitch (string eventName, float newPitch)
 Sets the pitch value on active AudioEvents. More...
 
void SetLoopingContainerFrequency (string eventName, float newLoopTime)
 Sets an AudioEvent's container loop frequency More...
 
void ModulateVolume (string eventName, GameObject emitter, float volume)
 Sets the volume for active AudioEvents. More...
 
- Public Member Functions inherited from HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >
bool IsLoaded (TBank bank)
 
void LoadBank (TBank bank)
 
void UnloadBank (TBank bank)
 
void StopAllEvents ()
 Stops all ActiveEvents More...
 
void StopAllEvents (float fadeTime)
 Fades out all of the events over fadeTime and stops once completely faded out. More...
 
void StopAllEvents (GameObject emitter)
 Stops all events on a single emitter. More...
 
void StopAllEvents (AudioSource emitter)
 Stops all events on one AudioSource. More...
 

Protected Member Functions

new void Awake ()
 
override void BanksChanged ()
 Update the dictionary of available audio events. More...
 
- Protected Member Functions inherited from HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >
void Awake ()
 
void OnDestroy ()
 
void PlayContainer (ActiveEvent activeEvent)
 Determine which rules to follow for container playback, and begin the appropriate function. More...
 
void StopEvent (ActiveEvent activeEvent)
 Stop audio sources in an event, and clean up instance references. More...
 
IEnumerator StopEventWithFadeCoroutine (ActiveEvent activeEvent, float fadeTime)
 Coroutine for fading out an AudioSource, and stopping the event once fade is complete. More...
 
int GetInstances (string eventName)
 Return the number of instances matching the name eventName for instance limiting check. More...
 

Properties

Func< GameObject, GameObject > AudioEmitterTransform [get, set]
 Optional transformation applied to the audio event emitter passed to calls to play event. This allows events to be redirected to a different emitter. More...
 
static UAudioManager Instance [get]
 

Additional Inherited Members

- Public Attributes inherited from HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >
TBank [] DefaultBanks
 
- Protected Attributes inherited from HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >
TEvent [] Events
 
const float InfiniteLoop
 
List< ActiveEventActiveEvents
 
List< TBank > LoadedBanks
 

Detailed Description

The UAudioManager class is a singleton that provides organization and control of an application's AudioEvents. Designers and coders can share the names of the AudioEvents to enable rapid iteration on the application's sound similar to how XAML is used for user interfaces.

Definition at line 15 of file UAudioManager.cs.

Member Function Documentation

§ Awake()

new void HoloToolkit.Unity.UAudioManager.Awake ( )
protected

Definition at line 44 of file UAudioManager.cs.

§ BanksChanged()

override void HoloToolkit.Unity.UAudioManager.BanksChanged ( )
protectedvirtual

Update the dictionary of available audio events.

Reimplemented from HoloToolkit.Unity.UAudioManagerBase< AudioEvent, AudioEventBank >.

Definition at line 446 of file UAudioManager.cs.

§ ModulateVolume()

void HoloToolkit.Unity.UAudioManager.ModulateVolume ( string  eventName,
GameObject  emitter,
float  volume 
)

Sets the volume for active AudioEvents.

Parameters
eventNameThe name associated with the AudioEvents.
emitterThe GameObject associated, as the audio emitter, for the AudioEvents.
volumeThe new volume.

Definition at line 324 of file UAudioManager.cs.

§ PlayEvent() [1/3]

void HoloToolkit.Unity.UAudioManager.PlayEvent ( string  eventName)

Plays an AudioEvent.

Parameters
eventNameThe name associated with the AudioEvent.

The AudioEvent is attached to the same GameObject as this script.

Definition at line 56 of file UAudioManager.cs.

§ PlayEvent() [2/3]

void HoloToolkit.Unity.UAudioManager.PlayEvent ( string  eventName,
GameObject  emitter,
string  messageOnAudioEnd = null 
)

Plays an AudioEvent.

Parameters
eventNameThe name associated with the AudioEvent.
emitterThe GameObject on which the AudioEvent is to be played.
messageOnAudioEndThe Message to Send to the GameObject when the sound has finished playing.

Definition at line 67 of file UAudioManager.cs.

§ PlayEvent() [3/3]

void HoloToolkit.Unity.UAudioManager.PlayEvent ( string  eventName,
AudioSource  primarySource,
AudioSource  secondarySource = null 
)

Plays an AudioEvent.

Parameters
eventNameThe name associated with the AudioEvent.
primarySourceThe AudioSource component to use as the primary source for the event.
secondarySourceThe AudioSource component to use as the secondary source for the event.

Definition at line 78 of file UAudioManager.cs.

§ SetLoopingContainerFrequency()

void HoloToolkit.Unity.UAudioManager.SetLoopingContainerFrequency ( string  eventName,
float  newLoopTime 
)

Sets an AudioEvent's container loop frequency

Parameters
eventNameThe name associated with the AudioEvent.
newLoopTimeThe new loop time in seconds.

Definition at line 299 of file UAudioManager.cs.

§ SetPitch()

void HoloToolkit.Unity.UAudioManager.SetPitch ( string  eventName,
float  newPitch 
)

Sets the pitch value on active AudioEvents.

Parameters
eventNameThe name associated with the AudioEvents.
newPitchThe value to set the pitch, between 0 (exclusive) and 3 (inclusive).

Definition at line 276 of file UAudioManager.cs.

§ StopAll()

void HoloToolkit.Unity.UAudioManager.StopAll ( GameObject  emitter = null,
float  fadeOutTime = 0f 
)

Stops all.

Parameters
fadeOutTimeThe amount of time in seconds to completely fade out the sound.

Definition at line 219 of file UAudioManager.cs.

§ StopAllEvents()

void HoloToolkit.Unity.UAudioManager.StopAllEvents ( string  eventName,
GameObject  emitter = null,
float  fadeOutTime = 0f 
)

Stops all events by name.

Parameters
eventNameThe name associated with the AudioEvent.
fadeOutTimeThe amount of time in seconds to completely fade out the sound.

Definition at line 194 of file UAudioManager.cs.

§ StopEvent()

void HoloToolkit.Unity.UAudioManager.StopEvent ( string  eventName,
GameObject  emitter = null,
float  fadeOutTime = 0f 
)

Stops an AudioEvent.

Parameters
eventNameThe name associated with the AudioEvent.
emitterThe GameObject on which the AudioEvent will stopped.
fadeTimeThe amount of time in seconds to completely fade out the sound.

Definition at line 242 of file UAudioManager.cs.

§ StopEventsOnGameObject()

void HoloToolkit.Unity.UAudioManager.StopEventsOnGameObject ( string  eventName,
GameObject  gameObjectToStop,
float  fadeOutTime = 0f 
)

Stop event by gameObject.

Parameters
eventName
gameObjectToStop
fadeOutTime

Definition at line 175 of file UAudioManager.cs.

Property Documentation

§ AudioEmitterTransform

Func<GameObject, GameObject> HoloToolkit.Unity.UAudioManager.AudioEmitterTransform
getset

Optional transformation applied to the audio event emitter passed to calls to play event. This allows events to be redirected to a different emitter.

This class is a singleton, the last transform set will be applied to all audio emitters when their state changes (from stopped to playing, volume changes, etc).

Definition at line 31 of file UAudioManager.cs.

§ Instance

UAudioManager HoloToolkit.Unity.UAudioManager.Instance
staticget

Definition at line 40 of file UAudioManager.cs.


The documentation for this class was generated from the following file: