The general rule is:
Who should be used to refer to the subject of a sentence.
Whom should be used to refer to the object of a verb or preposition.
e.g.
- I know who your best friend is! (He/she is your best friend. Not *him/her is your best friend).
- With whom am I speaking? (I am speaking with him/her. Not I am speaking *with he/she) (IELTSsite)
Having said that, I cannot omit the fact that whom is considered formal, and in spoken language especially, people just say who:
Who are you going to call?
sounds fine to most ears, although the correct (considered perhaps hypercorrect by some) pronoun should be whom.
Also, when the verb of the sentence is followed by a preposition, you often hear such questions as:
Who are you working for? Who is he waiting for?
The formal way to ask these questions is to start with the preposition, in which case whom is strongly recommended straight after:
For whom are you working?
So if the preposition precedes the pronoun, who does sound incorrect. If the preposition is somewhere else in the sentence, who is actually more common.
As for your sentence, it does not make sense. I am just guessing what you want to say, so it could be something like:
It's important not to raise your voice to the person (whom/ who) you are speaking to.
To raise one's voice (to someone) is an idiom.