Is this a symptom of autism/related to autism?

I always feel like I have a very hard time communicating verbally to people and I can do it so much better through writing when my thoughts aren't spoken aloud. For my entire life, I never spoke much with people, most of the time only speaking to people (who weren't my family or close friends) after being spoken to first. In elementary school I remember being asked "Do you even speak?" and I would respond with a nod 😭 I've mostly struggled with speaking to people my age or close to it, adults are easier to talk to for me though I still get a lot of anxiety from it. I can speak to anyone but it's just extremely hard to sometimes. There have been countless times where I wanted to compliment a stranger but I couldn't get the words out. This also makes it hard for me to develop friendships as it takes a while for me to warm up to a person enough to be able to speak to them first without them having to say anything to me and most developing friendships will probably assume that I don't like them because I'm not speaking to them even though I really want to, I just can't. It's like there's a speaking permission button in my brain that gets pressed when someone speaks to me first but without the button being pressed, I can't get myself to say anything. But, if you were to force me to speak I would have the ability to do it, it's just hard to get past the mental barrier if that makes sense. I have no problem speaking to close friends or my family though I still get some anxiety with that like 'Will they like what I have to say?' or 'Is this the right time to ask this?' or 'Is it even worth saying anything to make random comments?' My friend who is diagnosed with ADHD and gets anxious around people has said that he experiences the having a hard time speaking to people first experience too so I'm not sure what this is. Is it related to autism or perhaps more anxiety related (though I know that autism causes anxieties related to these types of things)?