Hi Jijo2367, welcome to the HP Forums. When you play audio files, you are sometimes getting unwanted noises. This could be feedback from the built in microphone. Use this document to mute the microphone. See the section "Microphone or line-in device is not working with the computer / Step 2: Check volume and mute settings": Resolving Microphone and Line-in Problems (Windows 8)
Try a hard reset if that didn't work: Performing a Hard Reset or Forced Reset
If the issue still persists, to simplify troubleshooting, you need to focus on just the speakers first. Check the sound properties. Ignore the title of this document, as there are some portions I am using as reference: Get high-definition sound and music from your computer. First go to "Set up audio effects" and make sure the enhancements are all unchecked. Also on the advanced tab, what is the 'Default Format' set to?
If the issue still persists, what type of headphones are you using, are they USB or 3.5mm?
Let me know how it turns out.