mouseover audio function for web site build

Recording Techniques, People Skills, Gear, Recording Spaces, Computers, and DIY

Moderators: drumsound, tomb

Post Reply
Tragabigzanda
steve albini likes it
Posts: 366
Joined: Wed Mar 07, 2007 9:25 pm

mouseover audio function for web site build

Post by Tragabigzanda » Thu Dec 02, 2010 2:43 pm

So I've done my best to follow the instructions here, under #3:

http://www.phon.ucl.ac.uk/home/mark/audio/play.htm

But still no sound on mouseover. I'm using iweb, I'm new to web design, so I've got a few questions...

1. Is the author of the above link referring to something specific with "Evalsound," or is that just the name of the particular function?

2. Do I embed the first bit of code on the website body, and the 2nd bit over the picture I want to trigger the sound?

3. For multiple picture/sound combinations on a page (pic 1 triggers sound 1, pic 2 triggers sound 2, etc), do I have to re-embed both the 1st and 2nd bit of code for each picture/sound combination? Or can I just list all the audio files in the first embed and title them "sound1", "sound2", etc.

Thanks.

I hate html.
Alex C. McKenzie

User avatar
syrupcore
deaf.
Posts: 1793
Joined: Mon Mar 08, 2004 4:40 am
Location: Portland, Oregon
Contact:

Post by syrupcore » Sat Dec 04, 2010 11:48 am

Kind of a can of worms but...

Code: Select all

<input type="button" value="Play Sound" onClick="EvalSound&#40;'sound1'&#41;">
you'll need to change onClick to onMouseOver

You can add as many of those as you want.

Those are just referencing these:

Code: Select all

<embed src="success.wav" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">
You can add as many as you have sounds. You change the id attribute of each one along with the src attribute. so the second one would look like this:

Code: Select all

<embed src="sound2.wav" autostart=false width=0 height=0 id="sound2"
enablejavascript="true">
or

Code: Select all

<embed src="myGreatSong.wav" autostart=false width=0 height=0 id="myGreatSong"
enablejavascript="true">
and you would reference it like this:

Code: Select all

<input type="button" value="Play Sound" onMouseOver="EvalSound&#40;'myGreatSong'&#41;">
the

Code: Select all

 EvalSound&#40;'myGreatSong'&#41;
bit is a reference to the ID of the <embed> stuff up top.

That's untested but that's the idea. Problem may be that if some one mouses over something twice, the sounds will overlap.

Also, that code example is ancient in nerd years. "tested in IE6 and Firefox 1.0". There are a lot of newer libraries I'd be inclined to hitch my wagon to. http://www.schillmania.com/projects/soundmanager2/ looks pretty good. You can also try something with soundcloud https://github.com/soundcloud/Widget-JS-API/wiki[/code]

Tragabigzanda
steve albini likes it
Posts: 366
Joined: Wed Mar 07, 2007 9:25 pm

Post by Tragabigzanda » Sun Dec 05, 2010 2:26 pm

Rad, thanks for the info and link. I'll start working with it tomorrow and follow up soon...
Alex C. McKenzie

Tragabigzanda
steve albini likes it
Posts: 366
Joined: Wed Mar 07, 2007 9:25 pm

Post by Tragabigzanda » Mon Dec 13, 2010 4:15 pm

Found this to be a huge PITA (due to my own impatience, not your advice). Somewhere else on here was a great response that the Bandcamp widget was a great alternative, and I concur! Simple, easy to add to a page, and it's not Flash, so it can be viewed on iphone.
Alex C. McKenzie

Post Reply

Who is online

Users browsing this forum: No registered users and 183 guests