Can I tell a classmate to shut up?
Why do you want a classmate to shut up?
I don't want to hear in that voice anymore
It's mean to tell someone to be quiet just because you don't like their voice. That's rather rude.
It's not too mean if I don't know them well
It is more rude if you don't know them well, because how would you feel if a random person told you to shut up? It's just not a nice thing to do.