samples
The length of the audio clip in samples. (Read Only)
阅读时间1 分钟最后更新于 5 天前
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.AudioModule
public int samples { get; }
Remarks
Until the audio data is loaded (see AudioClip.loadState), this reports the length of the imported clip.
WebGL: The browser decodes audio data asynchronously. Once the clip is loaded, this reports the length of the decoded audio, which can differ slightly from the imported length, for example because of encoder padding or because the browser resamples the audio to the sample rate of its audio output.