The Samsung Galaxy S4, in particular, has an awesome built-in feature called Adapt Sound. Simply put, it fine tunes the sound output of the smartphone in accordance to the user's hearing and to what headphones are being used with the device. Adapt sound also improves your in-call quality and overall audio for better listening.
This app is currently for Galaxy S4 but it's been ported for all Galaxy devices. (Galaxy Note/2, Galaxy S2/3..)
You can get the Adapt Sound on GooglePlay by installing this app:
Galaxy S4 For all
(This app brings you more things like S4 Alarms, notifications, UI-Sounds, some apps and wallpapers).
Please note that the application's density is set for 5´ so If you want to use it, you have to change its density because you won't be able to see all of the controls.
I recommend THIS app.