Click or drag to resize

AudioControllerPlayAudioItem Method

Plays a specific AudioItem.

Namespace:  (Default Namespace)
Assembly:  AudioToolkit (in AudioToolkit.dll) Version: 8.2.0.0 (8.2.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,
	float startVolumeMultiplier = 1f
)

Parameters

sndItem
Type: (Default Namespace)AudioItem
the AudioItem
volume
Type: SystemSingle
the volume
worldPosition
Type: Vector3
the world position
parentObj (Optional)
Type: Transform
the parent object, or null
delay (Optional)
Type: SystemSingle
the delay in seconds
startTime (Optional)
Type: SystemSingle
the start time seconds
playWithoutAudioObject (Optional)
Type: SystemBoolean
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: SystemDouble
The high precision DSP time at which to schedule playing the audio [default=0]
playAsMusicOrAmbienceSound (Optional)
Type: SystemBoolean
Determines if it is effected by sound muting [default=false]
startVolumeMultiplier (Optional)
Type: SystemSingle
allows to adjust the start volume if e.g. a FadeOut will follow immediately after

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