# Music Player Sound Rollover

**URL:** <https://forum.kirupa.com/t/music-player-sound-rollover/149408>\
**Category:** web dev\
**Created:** [May 28, 2005, 9:26pm UTC](https://forum.kirupa.com/t/music-player-sound-rollover/149408 "2005-05-28T21:26:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameeb](https://avatars.discourse-cdn.com/v4/letter/c/57b2e6/32.png) [@Cameeb](https://forum.kirupa.com/u/Cameeb)\
**Post date:** [May 28, 2005, 9:26pm UTC](https://forum.kirupa.com/t/music-player-sound-rollover/149408/1 "2005-05-28T21:26:47Z")

</div>

I’m fairly new at HTML, i created a link to where when you moused over it, it would play a .wav file, only problem with this is it opens up the Realone player instead of just playing from the browser. Is there a way i can make my browser play the file instead of one of my players?

heres my script…

\<head\>  
\<Script\>  
function MM\_controlSound(x, \_sndObj, sndFile) {  
var i, method = “”, sndObj = eval(\_sndObj);  
if (sndObj != null) {  
if (navigator.appName == ‘Netscape’) method = “play”;  
else {  
if (window.MM\_WMP == null) {  
window.MM\_WMP = false;  
for(i in sndObj) if (i == “ActiveMovie”) {  
window.MM\_WMP = true; break;  
} }  
if (window.MM\_WMP) method = “play”;  
else if (sndObj.FileName) method = “run”;  
} }  
if (method) eval(\_sndObj+"."+method+"()");  
else window.location = sndFile;  
}  
\</Script\>  
\<!-- End Sound Link --\>  
\</head\>

\<body\>

\<embed name=‘MM\_playSound’ src=‘music/homepage.wav’ loop=false autostart=false mastersound=‘mastersound’ hidden=true volume=100 width=0 height=0\>\</embed\>  
\<a href=“homepage.html” onmouseover=“MM\_controlSound(‘play’, ‘document.MM\_playSound’, ‘music/homepage.wav’);”\>Home\</a\>

- thanks
