API reference
API reference
Select your platform
No SDKs available
No versions available

UnityAudioPlayer Class

Unity specific audio player that will play any IAudioClipStream that includes an IAudioClipProvider or RawAudioClipStreams via AudioClip streaming.

Fields

AudioSource AudioSource[Get]
bool CloneAudioSource[Get]
Whether the player is currently playing back audio
Elapsed samples can be used if not using a clip buffer
Use time samples directly if possible, otherwise leave it to TTS to determine elapsed samples

Member Functions

Performs all player initialization
A string returned to describe any reasons playback is currently unavailable
Performs a pause if the current clip is playing
Performs a resume if the current clip is paused
Stops playback & removes the current clip reference

Protected Functions

Get local audio clip
Sets audio clip via an IAudioClipProvider or generates one if using a RawAudioClipStream. Then begins playback at a specified offset.
Parameters
offsetSamples
The starting offset of the clip in samples
Destroy clip if applicable
Did you find this page helpful?