error CS1002: ; expected

Hello I think this may seem obvious. I am trying to create an audio player in unity following this tutorial

but I keep getting this message what am I missing
Assets/AudioManager.cs(48,15): error CS1002: ; expected

line 48 is
yeild return null;
I am using unity 2019.3.13f1

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using UnityEngine.UI;
using UnityEngine.Audio;

[RequireComponent(typeof(AudioSource))]

public class AudioManager : MonoBehaviour
{

  public AudioClip[] muiscClips;
  private int currentTrack;
  private AudioSource source;


    // Start is called before the first frame update
    void Start()
    {
      source = GetComponent<AudioSource>();

      //play music
      PlayMusic();


    }

    public void PlayMusic()
    {
      if (source.isPlaying)
      {
        return;
      }

      currentTrack--;
      if (currentTrack < 0)
      {
        currentTrack = musicClips.Length - 1;
      }
      StartCoroutine(WaitForMusicEnd());
    }

    IEnumerator WaitForMusicEnd()
    {
      while(source.isPlaying)
      {
        yeild return null;
      }
      NextTitle();

    }

    public void NextTitle()
    {
      source.Stop();
      currentTrack++;
      if(currentTrack > musicClips.Length -1)
      {
        currentTrack = 0;
      }

      source.clip = musicClips[currentTrack];
      source.Play();

      //show title

      StartCoroutine(WaitForMusicEnd());

    }
}

You spelled Yield wrong,

yield return null;

Just copy that into line 48

2 Likes

thank you! its always the obvious mistakes