Little bit of advice. It's not a 'Life Hack' you need, you should be able to live in your house as a home and not be forced to find contraptions to get around this problem, they will only cost you money/annoyance.
I had that problem and I love loud music, but I was getting it very late at night when I have to go to work. All it took was a knock on the door a few words (which didn't work) then a delightful threat of physical violence or a trip to non-emergency police. Let's face it, it's anti-social behavior really. Understandingly not many people would want to confront people especially if there is more than one person or of the thought of creating bad karma around the neighbourhood. Therefore my top tip would be to anonymously call the non-emergency police, if it persists, call them again and again until you have a patrol officer. That is just my opinion, however if you do require a life hack, good luck!
My experience has been with a church, which refused to keep things quiet during revivals. So depending on whom your dealing with use this with caution as you can start more issues than just dealing with the noise. Also first thing is to always try and talk to the person(s) calmly and choose your words carefully. Mentioning sleeping kids can also help. The police can be helpful infrequently, more so the poorer the neighborhood you live in. And also some people/groups are going to get preferential treatment over others from the police.(Yes, from experience) On multiple occasions police in my old neighborhood refused to enforce local ordinances, and other laws being broken by the church I lived next to.
However, if everything else has failed, be a prick. Find the Panic button on your car, press it and wait. Within 10 minutes the revival group I had been dealing with started packing things up and continued to do so about an hour early every day. When they had been playing until 8PM in a residential neighborhood they started packing things up by 7 as I had already politely asked them to do, but to which they initially refused.
When my daughter and her boyfriend were at college and trying to study in the evenings, they had loud music from the next door house. They solved the problem by recording the music for as long as it was on, then played it back as loud as they could, putting the speakers pressed up against the neighbouring wall, when it went quiet during the night, presumably when the offender was asleep; it didn't happen again!
For many years, I've used a recording of surf sounds playing on repeat to blanket outside noise -- primarily when I sleep, but it will work any time. An air conditioner or fan can do similar service. This isn't very practical while (for instance) watching TV, but the TV has its own volume control.
Normally a local authority of some form can do something, contact your council, or whatever government authority you have around there. In the meantime earplugs can work, or wearing headphones/earphones and listening to something else.
You don't describe the specific situation in detail (is this at night, in the day?, when you're trying to sleep?) so it's hard to give any more specific advice.
If you are being harmed by the actions of your neighbors--deprived of "quiet enjoyment" of your home because they're inconsiderate, then you simply sue them in small claims court, if they own the property, for damages.
If they ignore the summons (delivered by a server, not you) you will be awarded a default judgement. You can then proceed to lien the property for the amount of the judgement.
If they are tenants, you sue the property owner for damages and sue him to evict the tenants. If you allow it, it will only get worse. Civil remedies work and really get their attention. You can sue for up to $3500 in small claims court in my jurisdiction. Go get 'em.
I have the same problem where I live (traffic, shouting people, renovations, loud tv, crappy music...you name it). I found that what works best is earplugs AND noise cancelling ear muffs together (they cancel different wavelenghts).
When we are to face a situation where our neighbourer or some car owner in the locality make a loud music creating a great disturbance. In such problem, wearing earplugs is not a permanent solution. We are to request the neighbourer or the car owner , very politely, to stop the loud music as it creates disturbance in the studies of our children or as our parents are suffering from disease or whatever the reason may be. If he agrees, then it is fine. If he still persists, then we have to make pressure on him through some reputed persons or through association of the locality. If he still persists , then we will threat him that we will report the matter to the police and if he still, then we will bring the reputed persons and the association into confidence and report to the police.