Asallam u Aleikum, One day when I was out and the time for prayer came there was nowhere else to pray so I went to a clothes store changing room and prayed there. However there was music playing in the store which I could hear but tried my best to ignore. Was my prayer valid or does it have to be repeated ?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His Slave and Messenger.
Your prayer is valid and it does not become invalidated just because of listening to music, especially since you tried your best not to listen to it. Nonetheless, some jurists are of the view that the prayer becomes invalidated by listening intently to something outside the prayer if it is exceedingly much.
The commentary on Mukhtasar Khaleel by Al-Kharashi of the Maaliki School reads: “If one listens intently for too long (i.e. to something outside the prayer), then this makes his prayer invalid, because he was distracted from the prayer; and if it was somewhat reasonable, he should do Sujood (prostration of forgetfulness) after Tasleem, that is, if it was out of forgetfulness. The assessment of whether it lasted for a long or short or moderate time is according to custom.”
The commentary of Ad-Dusooqi, from the Maaliki School, reads the same: “Minuteness, length and moderateness is according to custom. '...minute...' implicitly means that if he listens for too long, even if out of forgetfulness, then the prayer is invalid, and if it was moderate, then if it was out of forgetfulness, he does Sujood after the prayer, and if it was deliberate, it invalidates the prayer.”
In the future, you should strive to pray in a place free from noise and especially from music. It is better for a Muslim to pray in a place that is free from anything that distracts the mind and prevents the heart from being attentive in the prayer, reciting the Quran, supplicating and submissiveness during prayer. An authentic Hadeeth reads: “…Then, if he stands up for the prayer and praises Allaah, glorifies Him, proclaims His Greatness as He deserves, and devotes his heart wholly to Allaah, he emerges free from sin, just as the day he was born.” [Muslim]
Another authentic Hadeeth reads: “Whoever performs Wudhoo' (minor ablution) in the same manner that I had performed it, and then he prays two Rak’ahs without thinking of other things, then his previous sins will be forgiven.” [Al-Bukhari and Muslim]
Allaah Knows best.
You can search for fatwa through many choices