"the sound is extremely muffled" and you have replaced the AVR.....so I would suspect the speakers, unless you say the speakers sound fine with some sources.
An optical cable cannot make things sound muffled.
A weak network would not make things sound muffled.
I suppose the ATV might be broken but you aren't using any of the analog aspects of the ATV, and there isn't a thing in the digital domain that muffles sound like you describe.
But that AVR is 15 years old, right? I'm guessing the budget is limited and that is why you chose it. No problem.
If the speakers are fine (ie, they sound good except when using the ATV) then we can conclude that the speakers and AVR are okay. So then replacing the ATV may be what's needed. If all you want is a device to stream to, I'd probably choose a bluetooth dongle like:
Most newer AVR's have bluetooth capability, and many have Airplay, but your Sony appears to be a little old than that feature set. So this MIGHT be a $22 solution. But I would only get it is I could play other sources and they sound fine.