Don't.
I mean, is there anything more annoying than surfing the web quietly, while your kid is asleep, then some site has cheesy music in the background? Or how about at work? Most times when I'm online, I have my OWN music going. I don't wanna hear some website's "background" music.
Sorry I'm zero help with how to do what you're trying to do. I'm just offering my (admittedly unsolicited) advice as to why you shouldn't.
That is all.