What is the difference between ( was playing and had been playing here ) what is the correct choise ?
This depends on the context of the rest of the sentence. If you were telling a story, you would use
was playing or
had been playing
Person A: Why do you look so tired?
Person B: someone next door was playing/had been playing heavy metal music all night long.
In this situation, both those two options work, but
was playing sounds better, and is overall the better choice.
If you were having a conversation with someone whilst the music was playing, then you could use one of the other two options.
Person B (on the phone to person A): I'm so tired Person A: Why? Person B: Someone next door has played/has been playing heavy metal music all night.
In this context,
has been playing is the better way to say it.