Click or drag to resize

AudioControllerPlayAmbienceSound Method (String, Transform, Single, Single, Single)

Plays an audio item with the name audioID as ambience sound at the specified position.

Namespace:  (Default Namespace)
Assembly:  AudioToolkit (in AudioToolkit.dll) Version: (
public static AudioObject PlayAmbienceSound(
	string audioID,
	Transform parentObj,
	float volume = 1f,
	float delay = 0f,
	float startTime = 0f


Type: SystemString
The audio ID.
Type: Transform
The parent transform or null.
volume (Optional)
Type: SystemSingle
The volume between 0 and 1 [default=1].
delay (Optional)
Type: SystemSingle
The delay [default=0].
startTime (Optional)
Type: SystemSingle
The start time [default=0]

Return Value

Type: AudioObject
Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReferenceT to store an AudioObject reference if you have pooling enabled.
PlayAmbienceSound makes sure that only one ambience track is played at a time. If cross fading is enabled in the AudioController fading is performed automatically.
See Also