Make a Genius Bar appointment with the nearest Apple Store to have them diagnose the problem for you. By the way, I'm assuming you're referring to an iPhone. Alternatively, you can try inserting the plug of an earpod into the earphone slot and then eject it to see if the sound returns to normal. Also, try cleaning out the earphone slot as well as make sure the device is not connected via Bluetooth.