Jump to content

Playing Audio


mentalist

Recommended Posts

Hi,

 

I can embed an audio file and get it to play and stop, but I don't seem to be able to hide the big box it comes with and still play the file... Any ideas?

 

<div style='display:none;'>x<embed id='sound' src='' width='1px' height='1px'></div>
<script>
function PlaySound(url){
document.getElementById('sound').src=url;
}
</script>
<a href="#" onmouseover="PlaySound('src/2_for_joy_-_in_a_state.mp3')">Play</a> 
<a href="#" onmouseover="PlaySound('');">Stop</a>

 

Also how browser safe is the underlying sound playing code?

What do you use to play audio?

Link to comment
https://forums.phpfreaks.com/topic/212086-playing-audio/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.