FFT.StartPlay C# (CSharp) Method

StartPlay() private method

private StartPlay ( AudioClip buffer ) : IEnumerator
buffer AudioClip
return IEnumerator
    private IEnumerator StartPlay(AudioClip buffer)
    {
        audioObj[index].SetClip(buffer);
        yield return new WaitForSeconds(.01f);
        audioObj[index].player.SetActive(true);
        audioObj[index].player.GetComponent<AudioSource>().Play();

        audioObj[Mathf.Abs((index % 2) - 1)].player.GetComponent<AudioSource>().Stop();

        index++;
        if (index > 1)
        index = 0;
    }