Struct AudioClip
An AudioClip represents a single audio resource that can play back on one or more AudioSource components.
Namespace: Unity.Tiny.Audio
Syntax
public struct AudioClip : IComponentData
Remarks
If only one AudioSource component references the AudioClip, you can attach the AudioClip component to the same entity as that AudioSource component.
If multiple AudioSource components reference the audio clip, it's recommended that you add the AudioClip component to a separate entity.
To perform the load of the audio resource, the AudioClip must have:
- An AudioClipLoadFromFileAudioFile to specify the location of the resource.
- An AudioClipLoadFromFile which initiates the load.
Note that this is a System, so that the actual loading will not be synchronous.
mgr.AddComponentData(eClip, new AudioClip());
mgr.AddBufferFromString<AudioClipLoadFromFileAudioFile>(eClip, "path/to/file.wav");
mgr.AddComponent(eClip, typeof(AudioClipLoadFromFile));
Fields
status
The AudioClip load status. The AudioClipStatus enum defines the possible states.
Declaration
public AudioClipStatus status
Field Value
Type | Description |
---|---|
AudioClipStatus |