I've found that this design does a good job of blocking out loud noises while keeping quieter noises pretty hearable:
There was a name for the tech/reason why it works but I forget. I stopped using them and started using a more comfortable design and ditched the music: The distraction it provides isn't worth it to me.