Search Results for

    Show / Hide Table of Contents

    Class AudioClip

    Audio clip stores audio data in a compressed or uncompressed format using a binary asset. Clips can be provided to audio sources or other audio methods to be played.

    Inheritance
    System.Object
    Object
    Asset
    BinaryAsset
    AudioClip
    Inherited Members
    BinaryAsset.Reimport()
    BinaryAsset.ImportPath
    Asset.Reload()
    Asset.WaitForLoaded(Double)
    Asset.GetReferences()
    Asset.Save(String)
    Asset.ToString()
    Asset.ReferencesCount
    Asset.Path
    Asset.IsLoaded
    Asset.LastLoadFailed
    Asset.IsVirtual
    Asset.ShouldDeleteFileOnUnload
    Asset.MemoryUsage
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public class AudioClip : BinaryAsset

    Constructors

    AudioClip()

    Initializes a new instance of the AudioClip.

    Declaration
    public AudioClip()

    Properties

    Format

    Gets the audio data format.

    Declaration
    [Unmanaged]
    public AudioFormat Format { get; }
    Property Value
    AudioFormat

    Info

    Gets the audio data info metadata.

    Declaration
    [Unmanaged]
    public AudioDataInfo Info { get; }
    Property Value
    AudioDataInfo

    Is3D

    Returns true if the sound source is three dimensional (volume and pitch varies based on listener distance and velocity).

    Declaration
    [Unmanaged]
    public bool Is3D { get; }
    Property Value
    System.Boolean

    IsStreamable

    Returns true if the sound is using data streaming.

    Declaration
    [Unmanaged]
    public bool IsStreamable { get; }
    Property Value
    System.Boolean

    IsStreamingTaskActive

    Returns true if the sound data is during streaming by an async task.

    Declaration
    [Unmanaged]
    public bool IsStreamingTaskActive { get; }
    Property Value
    System.Boolean

    Length

    Gets the length of the audio clip (in seconds).

    Declaration
    [Unmanaged]
    public float Length { get; }
    Property Value
    System.Single

    Methods

    ExtractData(out Byte[], out AudioDataInfo)

    Extracts the source audio data from the asset storage. Loads the whole asset. The result data is in an asset format.

    Declaration
    [Unmanaged]
    public bool ExtractData(out byte[] resultData, out AudioDataInfo resultDataInfo)
    Parameters
    System.Byte[] resultData

    The result data.

    AudioDataInfo resultDataInfo

    The result data format header info.

    Returns
    System.Boolean

    True if failed, otherwise false.

    ExtractDataFloat(out Single[], out AudioDataInfo)

    Extracts the raw audio data (PCM format) from the asset storage and converts it to the normalized float format (in range [-1;1]). Loads the whole asset.

    Declaration
    [Unmanaged]
    public bool ExtractDataFloat(out float[] resultData, out AudioDataInfo resultDataInfo)
    Parameters
    System.Single[] resultData

    The result data.

    AudioDataInfo resultDataInfo

    The result data format header info. That output data has 32 bits float data not the signed PCM data.

    Returns
    System.Boolean

    True if failed, otherwise false.

    ExtractDataRaw(out Byte[], out AudioDataInfo)

    Extracts the raw audio data (PCM format) from the asset storage. Loads the whole asset.

    Declaration
    [Unmanaged]
    public bool ExtractDataRaw(out byte[] resultData, out AudioDataInfo resultDataInfo)
    Parameters
    System.Byte[] resultData

    The result data.

    AudioDataInfo resultDataInfo

    The result data format header info.

    Returns
    System.Boolean

    True if failed, otherwise false.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)

    See Also

    BinaryAsset
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat