Version: 2017.4
public void Play (ulong delay= 0);

パラメーター

delay44100 Hz のサンプリングレートとしてサンプルの数だけ遅延します ( Play(44100) は 1 秒再生を遅らせることを意味します) 。

説明

一定のディレイを持たせて clip を再生します。

遅延パラメーターは非推奨です。代わりに秒単位で遅延を指定する新しい PlayDelayed 関数を使用してください。

If AudioSource.clip is set to the same clip that is playing then the clip will sound like it is re-started. AudioSource will assume any Play call will have a new audio clip to play.

Note: To obtain sample accuracy with an AudioClip with a different samplerate (than 44.1 khz) you have to do the math yourselves. Delaying an audiosource with an attached AudioClip with samplerate of, say, 32 khz, with 16k samples(.5 sec) is done by Play(22050). ((44100/32000) * 16000 = 22050).

注意: AudioSource.PlayScheduled はオーディオクリップを再生するときに正確な制御を行うことができます。

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AudioSource))] public class ExampleClass : MonoBehaviour { void Start() { AudioSource audio = GetComponent<AudioSource>(); audio.Play(); audio.Play(44100); } }

参照: StopPause:: 、 clipPlayScheduled 関数。