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

Namespace: (Default Namespace)
Assembly: AudioToolkit (in AudioToolkit.dll) Version: 6.5.0.0 (6.5.0.0)

Syntax

C#
public static AudioObject PlayMusic(
	string audioID,
	Transform parentObj,
	float volume,
	float delay,
	float startTime
)

Parameters

audioID
Type: System..::..String
The audio ID.
parentObj
Type: Transform
The parent transform or null.
volume
Type: System..::..Single
The volume between 0 and 1 [default=1].
delay
Type: System..::..Single
The delay [default=0].
startTime
Type: System..::..Single
The start time [default=0]

Return Value

Returns the reference of the AudioObject that is used to play the audio item, or null if the audioID does not exist. Warning: Use PoolableReference<(Of <(<'T>)>)> to store an AudioObject reference if you have pooling enabled.

Remarks

PlayMusic makes sure that only one music track is played at a time. If music cross fading is enabled in the AudioController fading is performed automatically.

See Also