Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Audio without player

Status
Not open for further replies.

KAK

Programmer
Jul 13, 2001
9
US
I would like to have audio play when a user clicks on an image but I don't want it to open up a player like realplayer. I would just like to audio to play (like it would in Flash, but I can't use Flash in this instance). Please help. Thanks!
 
hi
i think some sort of embed would help you to do that..

i'm not saying that this EXACTLY piece of code would work, but it is one of the ways:

<html><head><title>playing sounds</title>
<script language=&quot;JavaScript&quot;>
<!--
var MUSICstop=false;
function PLAY_STOPsnd(_sndObj) {
var method = &quot;&quot;, sndObj = eval(document.embeds(_sndObj));
if (sndObj != null) { method =(!MUSICstop)?&quot;play&quot;:&quot;stop&quot;; }
MUSICstop=(!MUSICstop)?true:false;
if (method) eval(_sndObj+&quot;.&quot;+method+&quot;()&quot;);
}
//-->
</script>
</head>
<body bgcolor=&quot;#FFFFFF&quot; onclick=&quot;PLAY_STOPsnd('document.trr900')&quot;>
<EMBED NAME='trr900' SRC='../../../bla.wav' LOOP=true
AUTOSTART=false MASTERSOUND HIDDEN=true WIDTH=0 HEIGHT=0>
</EMBED>
</body>
</html>
Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top