AudioClip

Struct AudioClip 

Source
pub struct AudioClip {
Show 20 fields pub m_Name: String, pub m_3D: Option<bool>, pub m_Ambisonic: Option<bool>, pub m_AudioData: Option<Vec<u8>>, pub m_BitsPerSample: Option<i32>, pub m_Channels: Option<i32>, pub m_CompressionFormat: Option<i32>, pub m_Format: Option<i32>, pub m_Frequency: Option<i32>, pub m_IsTrackerFormat: Option<bool>, pub m_Legacy3D: Option<bool>, pub m_Length: Option<f32>, pub m_LoadInBackground: Option<bool>, pub m_LoadType: Option<i32>, pub m_PreloadAudioData: Option<bool>, pub m_Resource: Option<StreamedResource>, pub m_Stream: Option<i32>, pub m_SubsoundIndex: Option<i32>, pub m_Type: Option<i32>, pub m_UseHardware: Option<bool>,
}
Expand description

AudioClip is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: A container for audio data. An AudioClip stores the audio file either compressed as ogg vorbis or uncompressed.

AudioClips are referenced and used by AudioSources to play sounds.See Also: AudioClip component in the Components Reference.

Fields§

§m_Name: String

The name of the object.

§m_3D: Option<bool>

bool: (3.4.0 - 4.7.2)

§m_Ambisonic: Option<bool>

Returns true if this audio clip is ambisonic (read-only). bool: (2017.1.0b1 - 2022.3.2f1)

§m_AudioData: Option<Vec<u8>>

Vec: (3.4.0 - 4.7.2)

§m_BitsPerSample: Option<i32>

i32: (5.0.0f4 - 2022.3.2f1)

§m_Channels: Option<i32>

The number of channels in the audio clip. (Read Only) i32: (5.0.0f4 - 2022.3.2f1)

§m_CompressionFormat: Option<i32>

i32: (5.0.0f4 - 2022.3.2f1)

§m_Format: Option<i32>

i32: (3.4.0 - 4.7.2)

§m_Frequency: Option<i32>

The sample frequency of the clip in Hertz. (Read Only) i32: (5.0.0f4 - 2022.3.2f1)

§m_IsTrackerFormat: Option<bool>

bool: (5.0.0f4 - 2022.3.2f1)

§m_Legacy3D: Option<bool>

bool: (5.0.0f4 - 2022.3.2f1)

§m_Length: Option<f32>

The length of the audio clip in seconds. (Read Only) f32: (5.0.0f4 - 2022.3.2f1)

§m_LoadInBackground: Option<bool>

Corresponding to the “Load In Background” flag in the inspector, when this flag is set, the loading will happen delayed without blocking the main thread. bool: (5.0.0f4 - 2022.3.2f1)

§m_LoadType: Option<i32>

The load type of the clip (read-only). i32: (5.0.0f4 - 2022.3.2f1)

§m_PreloadAudioData: Option<bool>

Preloads audio data of the clip when the clip asset is loaded. When this flag is off, scripts have to call AudioClip.LoadAudioData() to load the data before the clip can be played. Properties like length, channels and format are available before the audio data has been loaded. bool: (5.0.0f4 - 2022.3.2f1)

§m_Resource: Option<StreamedResource>

StreamedResource: (5.0.0f4 - 2022.3.2f1)

§m_Stream: Option<i32>

i32: (3.4.0 - 4.7.2)

§m_SubsoundIndex: Option<i32>

i32: (5.0.0f4 - 2022.3.2f1)

§m_Type: Option<i32>

i32: (3.4.0 - 4.7.2)

§m_UseHardware: Option<bool>

bool: (3.4.0 - 4.7.2)

Trait Implementations§

Source§

impl Debug for AudioClip

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AudioClip

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AudioClip

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,