Praise be to Allah.
It is haraam to play music or to listen to it. There is a great deal of evidence to prove that, such as the words of the Prophet (peace and blessings of Allaah be upon him):
“There will be among my ummah people who permit adultery, silk, alcohol and musical instruments…” This was narrated by al-Bukhaari in a mu’allaq report, no. 5590. al-Tabaraani and al-Bayhaqi narrated it in a mawsool report. See al-Silsilah al-Saheehah by al-Albaani, 91.
Ibn al-Qayyim (may Allaah have mercy on him) said: This is a saheeh hadeeth which was narrated by al-Bukhaari in his Saheeh and quoted it as mu’allaq majzoom.
The word used in the hadeeth is ma’aazif, which literally means musical instruments. This includes all kinds of musical instruments. See also question no. 5011.
Shaykh al-Albaani (may Allaah have mercy on him) said in al-Silsilah al-Saheehah, 1/145:
Some contemporary scholars make an exception for military music, but there is no basis for that at all, for several reasons:
1 – This is making an exemption from the general meaning of the hadeeth when there are no grounds for doing so, apart from personal opinion and judgement. This is invalid.
2 – At times of war, the Muslims are obliged to turn with all their hearts to their Lord, and to ask Him to support them against their enemies. This will bring them greater peace of mind and keep them steadfast and calm. Using music is something that will spoil that and distract them from remembering Allaah. Allaah says (interpretation of the meaning):
“O you who believe! When you meet (an enemy) force, take a firm stand against them and remember the Name of Allaah much (both with tongue and mind), so that you may be successful”
3 – Using music is a tradition of the kaafirs, and it is not permissible for us to imitate them, especially in matters that Allaah has forbidden to us in general terms, such as music.
And Allaah knows best.