Need help with my slider

So im finding the hardest part about coding is knowing how to ask the right questions. I spent all day trying to figure this “simple” slider out haha. Ive finally decided to come back here and ask the pros. So here goes.

I have a slider, i have music that plays, i want the max length of the slider value to be the max length of the song so i can use the slider to work my way through a song. from all i can find out, it is supposed to just be AudioClip.Length, but visual studio can’t seem to find .Length(or .length) on either AudioClip, or audioClip.

Here is the code i have so far

public class musicTime : MonoBehaviour {

    public AudioSource audioClip;
    public Slider audioSlider;

    void Start()
    {
        
        audioSlider.minValue = 0f;
        audioSlider.maxValue = audioClip.length;
    }

    void Update()
    {
        
    }

    public void timeScale()
    {
        

    }

The following works for me:

using UnityEngine;
using UnityEngine.UI;

public class AudioSlider : MonoBehaviour
{
    public AudioClip audioClip;
    public Slider mySlider;

	void Start ()
    {
        mySlider.minValue = 0.0f;
        mySlider.maxValue = audioClip.length;
        Debug.Log("<color=orange>audio clip length: </color>" + audioClip.length);
    }
}

If VS does not know AudioClip and such, perhaps you missed the usings on top?

You mistakenly wrote public AudioSource audioClip;

The type is of AudioSource not AudioClip.

There is no variable AudioSource.length in AudioSource.

Use instead: public AudioClip audioClip;

try this :
public class AudioLength : MonoBehaviour
{

    #region Public_Variables
    public AudioClip audioClipLength; //Attach AudioClip 
    public Slider slider;//Attach Slider
    #endregion

    void Start()
    {
        float length;
        length = audioClipLength.length;
        Debug.Log("length" + length);
        slider.GetComponent<Slider>().maxValue = length;
    }
}