expression
to no one in particular
Used when speaking or muttering without directing words at a specific person. Often appears with verbs like 言う or つぶやく.
See also: とも無く (ともなく)
彼は誰にともなく「疲れた」と言った。
He said "I'm tired" to no one in particular.
誰にともなく、彼女は小さくため息をついた。
She let out a small sigh, not directed at anyone.
ともなく is a broader pattern meaning 'without specifying' or 'not particularly'; 誰にともなく specifically means 'to no one in particular'.
Combination of 誰に (to whom) + ともなく (without specifying). The phrase is a fixed expression meaning 'to no one in particular'.