Praise be to Allah.
We have previously discussed music and the prohibition on it, and scholarly views concerning it, in the answer to question no. 5011.
The scholars have differentiated between the issues of hearing and listening, but what you are asking about is not included in this differentiation.
It was narrated that Naafi‘, the freed slave of Ibn ‘Umar, said: Ibn ‘Umar heard the sound of a flute and he put his fingers in his ears and turned his mount away from the road and said to me: O Naafi‘, can you hear anything? I said: Yes. And he carried on until I said: No. Then he took his fingers out of his ears, brought his mount back to the road and said: I saw the Messenger of Allah (blessings and peace of Allah be upon him) when he heard the sound of a flute and did something like this.
Narrated by Abu Dawood (4924); classed as saheeh by al-Albaani in Tahreem Alaat at-Tarb (p. 116)
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
The prohibition only has to do with listening, not hearing. Hence if a man passes by people who are engaging in some prohibited kind of talk, he is not obliged to block his ears, but he should not listen unnecessarily. Hence the Prophet (blessings and peace of Allah be upon him) did not instruct Ibn ‘Umar to block his ears when he heard the shepherd’s flute, because he was not listening to it; rather he was merely hearing it.
End quote from Majmoo‘ al-Fataawa (11/630)
Shaykh al-Islam also said:
There is nothing in the hadith of the two girls to indicate that the Prophet (blessings and peace of Allah be upon him) was listening to their singing. The command not to listen and the prohibition only have to do with listening, not simply hearing. This is similar to the issue of seeing; the prohibition has to do with deliberately looking, not what one happens to see without choosing to do so. The same applies to smelling perfume; the pilgrim in ihram is only forbidden to deliberately smell it, but if he smells it without intending to, then there is no blame on him
The same applies in the case of encountering prohibited things through one of the five senses of hearing, sight, smell, taste and touch. Commands and prohibitions only have to do with what a person does deliberately; with regard to whatever happens without him choosing to do so, there is no command or prohibition having to do with that.
This is how we many understand the hadith of Ibn ‘Umar… Some people say – assuming the hadith is sound – that [the Prophet (blessings and peace of Allah be upon him)] did not instruct Ibn ‘Umar to block his ears. The response to that is that Ibn ‘Umar was not listening; rather he could hear it, and there is no sin in that. Rather the Prophet (blessings and peace of Allah be upon him) turned away seeking to do that which is more perfect and better, like one who is walking in the street and passes by some people who are engaging in some kind of prohibited talk, and blocks his ears so as not to hear it. This is better, but if he does not block his ears, he is not sinning thereby, unless hearing it would cause some harm in spiritual terms that cannot be warded off except by blocking one’s ears.
End quote from Majmoo‘ al-Fataawa (11/566, 567)
Thus it becomes clear that hearing refers to what comes to one’s ears from elsewhere, such as music on public transit and on planes, or from neighbours’ houses, or from passers-by on the street, or on the phone when contacting information services or some companies and airlines for booking.
But with regard to that which comes from a person’s own choices, or from devices under his control, then it is undoubtedly listening. When hearing reprehensible things that come from others, that you cannot stop, you do not have to block your ears, but with regard to that which comes from your own choices, then you are able to stop it and it is haraam to listen to it. Thus the difference between the two is clear.
The scholars of the Standing Committee were asked:
We have no choice but to hear songs and music, whether in the bus that takes us to work every day, or on buses and in taxis that we need to travel in sometimes. What is the ruling on that?
If you cannot stop the music in the bus, and you need to ride it because the distance is far and you have no other means of transportation, then there is no blame on you for that, but you must denounce the evil according to what you are able to do, even if it is only in your heart.
End quote from Fataawa al-Lajnah ad-Daa’imah (26/241)
They were also asked:
What is the ruling on hearing songs on the telephone that you have no choice but to listen to when you booking flights with airline companies? Because usually the phone is answered with a recording that asks you to wait, then it makes you listen to songs or music; this also happens in the introduction to some religious or academic seminars, when we want to study in a particular seminar or academic program.
Listening to songs is not permissible. As for hearing them without intending to – as happens in the street or on television – then we hope that there is nothing wrong with it.
End quote from Fataawa al-Lajnah ad-Daa’imah (26/238)
Hence if a person is watching the news or a documentary, and there appears the picture of a woman or the sound of music, then he has to look away or mute the sound of the music immediately.
Shaykh ‘Abd al-‘Azeez ibn Baaz (may Allah have mercy on him) was asked:
What is the ruling on listening to some useful programs, such as a round-up of newspaper stories and the like, that include music?
There is nothing wrong with listening to them and learning from them, so long as one turns the speakers down when the music begins, until it ends, because music is haraam. May Allah make it easy for us to keep away from it and its evil.
End quote from Fataawa ash-Shaykh Ibn Baaz (6/389)
And Allah knows best.