PDA

View Full Version : Playing a sound file



cadfan
Feb 13th, 2010, 02:01 PM
I would like to play a .wav sound file when someone hovers their mouse/pointer over an image. Could someone help me out here please. I am running a Linux OS. Thanks.

Philip M
Feb 13th, 2010, 03:20 PM
<img src = "yourImage.jpg" onmouseover ="document.embeds['musicfile'].play()" onmouseout = "document.embeds['musicfile'].stop()">

<embed src="yourMusicFile.wav" name="musicfile" hidden="true" autostart="false"></embed>

This works in IE but an additional plug-in Apple Quicktime is required for Firefox.


Made with real ingedients. - Walker's Thai chilli flavour crisps packet

cadfan
Feb 14th, 2010, 08:49 AM
I am not running any version/flavour of Internet Explorer only Ubuntu 9.10 (Karmic Koala) and Linux Mint 8 (Helena). No matter what i've tried so far i still can't get a sound out of Firefox. Although when the webpage is opened using either Opera 10.10 or Konqueror 4.3.2 the sound file plays immediately?

Would like to say a big thanks to Phillip M for the help!