Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


preloadAudioData

Enable this property in the Inspector to preload audio data from the audio clip when loading the clip Asset (Read Only).
Read time 1 minuteLast updated 9 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AudioModule
public bool preloadAudioData { get; }

Remarks

This can help prevent delays when you play an audio clip because the data is already loaded. If you disable this property, you need to call AudioClip.LoadAudioData to load the data before you play the clip. Properties like length, channels, and format are available before Unity loads the audio data. You can’t change this property during runtime. To change this setting before you enter Play mode, set Preload Audio Data in the Inspector of the audio clip or use AudioImporterSampleSettings.preloadAudioData.