Hello and welcome to Android Central. I would suggest a restart of the phone first, and then check to make sure there's no gunk in the earpiece. If it's still doing it after it may be a hardware issue. In that instance, I'd recommend taking it to a local repair shop to get an estimate.