If there is hum while I am playing then it can surely be heard in the wav file also no matter the charger is connected or not!
Actually no. I was trying to get you to understand if the noise was coupling in the a/d conversion and small signal amplifier section where it would get added to the wav file OR it is in the playback D/A and amplifier section. One does not ensure the other.
You seem to be sure of this so I'll leave you to figure it out on you own.