If you're saying when a game has focus in BB (rather than, is actually playing)..
Place the music file in the appropriate directory under "Music" (i.e. Nintendo 64), and give it the same name as the game file (i.e. Mario Kart 64).
C:\LaunchBox\Music\Nintendo 64\Mario Kart 64.mp3
If you want music played while playing a game, then you're probably getting into an autohotkey script, which shouldn't be too difficult, but beyond me.