AudioSourceExt.PlayClip Method

Ubiquitously plays an AudioClip.

Namespace: UltimateXR.Extensions.Unity.Audio
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public static AudioSource PlayClip(
	AudioClip clip,
	float volume = 1f,
	float delay = 0f,
	float pitch = 1f
)

Parameters

 

clip
Type: AudioClip
Reference to the sound clip file that will be played.
volume (Optional)
Type: System.Single
How loud the sound is at a distance of one world unit (one meter) [0.0, 1.0].
delay (Optional)
Type: System.Single
Delay time specified in seconds.
pitch (Optional)
Type: System.Single
Amount of change in pitch due to slowdown/speed up of the Audio Clip. Value 1 is normal playback speed.

Return Value

Type: AudioSource
The just created temporal AudioSource.

Remarks

This function creates an AudioSource but automatically disposes of it once the clip has finished playing.

See Also

Reference

AudioSourceExt Class
UltimateXR.Extensions.Unity.Audio Namespace