Make sure you have plugged correctly your headphones to your phone with Headphones Indicator. This app sends notifications every time you plug your headphones, so you can be sure that they are correctly plugged and and the phone speaker is not goig to play anything. This is nice when you are in in places like a library. You can also disable the notifications if you want.
Headphones Indicator is available in english, spanish, catalan, french and italian.
In Headphones Indicator 1.3.1Notifications are now ongoing.