public void Play (ulong delay= 0);

Parámetros

delayRetraso en la cantidad de muestras, asumiendo una frecuencia de muestreo de 44100Hz (lo que significa que Play (44100) retrasará la reproducción en exactamente 1 segundo).

Descripción

Reproduce el clip con un cierto delay opcional.

El parámetro de delay es obsoleto, por favor utilice la nueva función PlayDelayed en su lugar, pues especifica el retraso en segundos.

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).

Nota: El AudioSource.PlayScheduled API le dará a usted más control preciso sobre cuando el clip de audio se reproduce.

using UnityEngine;
using System.Collections;

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

Mirar también: las funciones Stop, Pause, clip y PlayScheduled.