Any way to code skipping song after pressing key on keyboard ?

Hello, I’m a beginner in coding in Unity and I need help in implementing skipping song after pressing selected key, because I tried to do it but without any luck. For now I have only music player that plays all songs I put in it. What I want is that after I press selected key, the next song plays and after reaching the end of playlist it goes back to the first song. Thanks in advance for all answers. Here’s the script for playing music:

public class MusicPlayer : MonoBehaviour
{
    public AudioSource audioSource;
    public AudioClip[] soundtrack;
    int i = 0;
    
    void Start ()
    {
        StartCoroutine(PlayMusic());
    }

    IEnumerator PlayMusic ()
    {
        yield return null;

        for (; i < soundtrack.Length; i++)
        {
            audioSource.clip = soundtrack*;*

audioSource.Play();

while (audioSource.isPlaying)
{
yield return null;
}
}
}
}

Good day.

first, you need a list of clips to be played.
when the clip is finished, the variable audioSource.isPlaying will become false, so you can detect it and change the clip to be played.

You can also use Input.Keycode to change the clip when user click a specific button or key.

Bye!