delay | Delay in number of samples, assuming a 44100Hz sample rate (meaning that Play(44100) will delay the playing by exactly 1 sec). |
Plays the clip with an optional certain delay.
@script RequireComponent(AudioSource) function Start() { audio.Play(); // Delay a clip by 1 sec (44100 samples) audio.Play(44100); }
using UnityEngine; using System.Collections; [RequireComponent(typeof(AudioSource))] public class Example : MonoBehaviour { void Start() { audio.Play(); audio.Play(44100); } }
import UnityEngine import System.Collections [RequireComponent(typeof(AudioSource))] public class Example(MonoBehaviour): def Start() as void: audio.Play() audio.Play(44100)