I want to play sound when receiving message, so i searched it and found many solution but the simplest solution that i found is
Try this one, i think it is the simplest solution that anyone ever seen...:)
you just do one thing that you should convert your beep.mp3 to beep.wav
because some browsers dont understand mp3 so you should just convert it to wav and then use this only 3 lines of code
this will play sound on when page is open/reload you can set it as you want, and one more thing js 1.6 or greater is required. hope this will solve your both problem.