WaitForSeconds to wait on AudioClip completion is not working

I have done this many times but this time I’m confused. I am using Unity3d 2018.4.3 and I am trying to unlock user controls after beginning audio finishes. I am doing the VERY basic code of Starting a Coroutine to wait and I have tried many iterations.

public void GiveInstructions(AudioClip clip)
{
     audioSource.clip = clip;
     audioSource.Play();
     // another approach (doesn't work) - new WaitForSeconds(clip.length);
    StartCoroutine(WaitForAudio(clip));
}

private IEnumerator WaitForAudio(AudioClip clip)
{
     // One approach(doesn't work)   - yield return WaitUntil(() => audioSource.isPlaying == false);
     //  Doesn't work - yield return new WaitForSeconds(clip.length);

     // Also doesn't work
     while (audioSource.isPlaying)
     {
         yield return null;
     }
}

Only thing that remotely works is the following:

void FixedUpdate()
{
    if (!audioSource.isPlaying)
    {
         // Do my thing
    }
}

And I am not about to do that hack.
Any help would be great.

I don’t see any reason why the coroutine shouldn’t work. However from your code it’s not clear what you actually want to do when the clip has finised playing. I assume that you don’t really understand the concept of coroutines, A coroutine runs independently from the calling code. If you want to execute some code after you waited for something, that code has to be placed after the waiting code inside the coroutine.

Using FixedUpdate is completely out of place. FixedUpdate is only for physics simulation. It usually runs slower than the normal framerate depending on your visual framerate and what fixedDeltaTime you have set.

You can not wait outside a coroutine as this would mean your whole application freezes. So a normal method can not wait for anything.

So this should work just fine:

private IEnumerator WaitForAudio(AudioClip clip)
{
    while (audioSource.isPlaying)
    {
        yield return null;
    }
    Debug.Log("This happens when the audioSource has finished playing");
    // place your code that should execute when the audio source has finised here.
}