I have this code inside OnGUI()
//BLA BLA
//when click button
StartCoroutine(PlayAudio(click,"email"));
//BLA BLA
and this method
private IEnumerator PlayAudio (AudioClip clip,string control)
{
audio.volume = 1.0f;
audio.loop = false;
audio.clip = clip;
audio.Play ();
yield return new WaitForSeconds(audio.clip.length);
//BLA BLA I do this after sound finish
}
The problem is that the sound doesnt start when i click but after a few millisecond,and I do not why.