Struct AudioClip | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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.

    Minimal code load a file:
        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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023