I’m sure this is frustrating and very difficult. It’s possible that you have developed some form of social anxiety. Social anxiety is the fear of being judged and evaluated negatively by other people. This often leads to embarrassment and over-concern with how others will respond to anything the person says. Although most teens do worry about how they are seen by others, teens with social anxiety find it especially difficult to get beyond their fears when asked to speak in front of others they aren’t sure about.
You aren’t worried about rejection from family and friends who love you. But with strangers and especially in class, you may literally “clam up” out of anxiety.
If you could have fixed this on your own, you would have done so already. For that reason, I do suggest that you make an appointment with a counselor to learn some strategies to reclaim your voice. Talk to your school counselor about how to find the right counselor for you.
In the meantime, you might find it helpful to check out the forum on anxiety right here at PsychCentral. People offer tips and support for each other.
I wish you well.