AudioController.PlayAudioItem Method

Audio Toolkit

Collapse image Expand Image Copy image CopyHover image
Plays a specific AudioItem.

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

Syntax

C#
public AudioObject PlayAudioItem(
	AudioItem sndItem,
	float volume,
	Vector3 worldPosition,
	Transform parentObj = null,
	float delay = 0f,
	float startTime = 0f,
	bool playWithoutAudioObject = false,
	AudioObject useExistingAudioObj = null,
	double dspTime = 0,
	bool playAsMusicOrAmbienceSound = false
)

Parameters

sndItem
Type: (Default Namespace)..::..AudioItem
the AudioItem
volume
Type: System..::..Single
the volume
worldPosition
Type: Vector3
the world position
parentObj (Optional)
Type: Transform
the parent object, or null
delay (Optional)
Type: System..::..Single
the delay in seconds
startTime (Optional)
Type: System..::..Single
the start time seconds
playWithoutAudioObject (Optional)
Type: System..::..Boolean
if trueplays the audio by using the Unity function PlayOneShot without creating an audio game object. Allows playing audios from within the Unity inspector.
useExistingAudioObj (Optional)
Type: (Default Namespace)..::..AudioObject
if specified this existing audio object is used instead of creating a new AudioObject
dspTime (Optional)
Type: System..::..Double
The high precision DSP time at which to schedule playing the audio [default=0]
playAsMusicOrAmbienceSound (Optional)
Type: System..::..Boolean
Determines if it is effected by sound muting [default=false]

Return Value

Type: AudioObject
The created AudioObject or null

Remarks

This function is used by the editor extension and is normally not required for application developers. Use Play(String) instead.

See Also