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.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class AudioClip : BinaryAsset
Constructors
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. |