Image - onClick, i'd like an .mp3 sound effect to play

Hello
I'm using CS4 Dreamweaver.  It would seem having a sound play when clicking on an image should be not too difficult, but I must confess I'm quite confused.   I have an image, I have a short .mp3 file..  how can i make this sound play onClick, as the image should also take the viewer to a new page?
I notice that I can use a behavior that is "deprecated" so I am guessing there is a better way?
Thank You

I have followed the instructions on the first link.  This seems to work.  I still need to also have the sound play and the image link to a new page.  As soon as I fill in the href=" ", it goes to the new page, but then doesn't play the sound.  Can I do both somehow?
current code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script language="javascript" type="text/javascript">
function playSound(soundfile) {
document.getElementById("dummy").innerHTML=
"<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
</script>
<body>
<span id="dummy"></span>
<a href="#" ><img src="book.jpg" width="416" height="288" border="0"onclick="playSound('Sound5.mp3');" /></a>
</body>
</html>
Thank You!
lsuel

Similar Messages

  • I have a MAC running Maverick. MP3 sounds will not play in Safari or FireFox, but will play if you download the file locally to the Desktop. How to resolve this?

    I have a MAC running Maverick. MP3 sounds will not play in Safari or FireFox, but will play if you download the file locally to the Desktop. How to resolve this?

    You probably have an internet plugin installed that is preventing the MP3s from playing. I just checked a site with an MP3, and it played, rather than downloaded.
    The internet plugin folders are at:
    /Library/Internet Plug-ins and
    ~/Library/Internet Plug-ins
    (~/Library is hidden by default. Let me know if you don't know how to access it.)
    My internet plugins were all in /Library; there were none in ~/Library.
    Try moving these folders to the desktop (don't delete them), restarting, and then seeing if the MP3s play.
    They it will be trial and error to see which plugin is responsible.

  • Flex Mobile - Sound Effect not Playing on List snapping (code sample provided)

    Hello All,
    I'm trying to figure out how to play a Sound Effect on the trigger of the "changing" event on a List.
    So basically I have:
    <s:List id="theList" width="100%"
                itemRenderer="MyIconItemRenderer" verticalScrollPolicy="off"
                pageScrollingEnabled="true" scrollSnappingMode="center"
                caretChange="playSound(event)"> ... </List>
    So the list above snaps to the item to be centered, though I would like on every snap, for it to make a click sound. I've added the method for playing the sound as:
    private var tickChange:Sound;
    private var soundEffectURLRequest:URLRequest = new URLRequest('/assets/sound/click.mp3');
    protected function playSound(event:IndexChangeEvent):void  {      
         tickChange = new Sound(soundEffectURLRequest);
         tickChange.play();
    The Sound effect plays, though it's not playing at every Snap interval, so if I scroll fast among them, it's not playing, only on the last selection.

    I can´t believe it.. While writing the previous post, I thought on a really simple solution and compiled it to give it a try. It works perfectly!
    As simple as setting the "cacheAsBitmap" property to "true" on the Spark lists of the views!! 

  • Randomize sound Effect and play effect from a spinnerList

    I have two separate questions:
    I have 8 different sound effects and a spinner list, in simpler terms, what do I need to do to assign 1 sound effect to each of the selections on the spinnerList, and then have the corresponding sound effect played when the user presses a button?
    Secondly, what do I need to do to make it so that every time a dofferent button is pressed, it plays a random one of those 8 sound effects?
    Some sample code would be great. Thanks.

    The basic approach to picking something randomly:
      // here's my array of items to choose from
                                            var strings:Array = ["a", "b", "c", "d", "e", "f", "g", "h"];
      // pick one of the items randomly
      // Math.random() gets a random # n where 0 <= n < 1
      // Multiply by array length to get a random index
      // Math.floor() makes it an integer index where 0 <= n < Array.length
                                            var s:String = strings[(Math.floor(Math.random() * strings.length))];
    HTH,
    -- Tom

  • Where can I get a hold of the "poof" sound effect that plays when you un-dock an app?

    I looked in the sounds file under system and it wasn't there. Is there a way I can get access to this sound?

    Ready for this?
    /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSoun ds/dock/
    In addition to the above potential for copyright infringement, the location might be a little different for Snow Leopard, so you're on your own there.
    In any event sticking your fingers in places deep within the system like this is not recommended. You could damage your computer by doing so. Good luck.

  • How do I get sound effects to play on my keyboard

    Basically, I've been tinkering with my Mac's sound files, And I've gotten a sound that I want to play whenever I press any key on my keyboard, I've been looking around in the system, but I cant seem to find anything that would allow me to do that, could someone lend me a hand?

    Which model iPad do you have?

  • How to create laser sound effects?

    Hey everyone, I have a question for you. I am working on a project and I would really like awesome laser sound effects. I have become pretty good at taking my voice and turning it into nice sound effects, but I cannot seem to take my voice and turn it into cool laser effects.
    This is what I would like to create: http://www.phstudios.com/projects/Audio/Laser.mp3
    If anybody has any ideas at all on what to do, please let me know. At the very least, what can I use as the source sound for this? My voice wont make a nice source for a decent laser.
    Also, I do not have this now, but will Logic Express be better for this?
    Thanks!

    SBfeld wrote:
    Here is my latest version: http://www.phstudios.com/projects/Audio/Laser%20Sound%20Effect_NEW.mp3
    It is a little quiet, but I am using this for a game so there will be other sounds going on at the same time.
    Sounds great. You could always add a bit more reverb, so it drifts off more - or leave as is. Frankly, I think it sounds fine. With all due respect to the lightsaber, the gold standard for the sound of light slashing through space, in reality, lasers don't really make any noise (do they?), so you can really do whatever you want. No one can say "that's not what lasers sound like" because light has no mass, sound, or bitter aftertaste.
    This is good for now. I will get Logic Express if you think it will help at least a little bit? I just dont want to spend $200 on it and not like it any better.
    If all you're trying to do is make a single sound, it's not worth getting Logic for. Also, Logic is a workstation, not an instrument, although it comes with instruments. So, in terms of creating things like laser sounds, I'd think it's less about all the control Logic gives you (although there is that), than it is about working with a really versatile virtual instrument, like the things NI puts out, or Omnisphere, or something along those lines and really versatile effects.
    But that's if you really want to get into it and work on sound effects and music beyond this particular laser. Which maybe you do.
    But if it's all about this laser, I'd just do what you're doing, or if you were going to purchase something, I'd look for a sound library (e.g. http://www.cycling74.com/products/cycles), find the sound you're looking for, and then tweak it.
    But... I wouldn't get Logic just to gussy up that one sound.
    Good luck with T.D.!

  • Sound Effects No Longer

    I noticed the other day that the sound effects that play while using the remote no longer do so. I checked the settings to be sure it is turned on. I even turned it off and back on. No sound effects. I guess it's not that big a deal, but I would like to have them back.
    Thanks

    try a reboot of the device. if that doesn't work then do a factory reset.

  • Quality. MAC friendly web source for sound effects?

    I like to include sound effects in my iMovie sideshows -- I like the Skywalker sounds but want some different unique ones --any one have a good site for MAC friendly downloads? I have been to sites with movie audio clips but can never figure how to download (no right click mouse) i know I sound like newbie --help!

    Couldn't live without Freeplay but it's mostly all music.
    Sue
    ___BTW___to right-click on a mac just hold down the control key and click

  • OpenAL sound effects not working .. Please Help

    Hi
    I ported OpenAL to our platform and able to play the wav files.
    I wrote a sample openal application and try to produce some sound effects.
    Play back of audio is working but sound effects are not working.
    I am using jungle.wav which is mono channel sound wave file as input
    # The Code snippet used is mentioned below.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>
    #define NUM 2
    alutInit(0,0) ;
    alGetError();
    SourcesPos[0] = SourcesPos[1] = SourcesPos[2] = 0.0f;
    ListenerPos[0] = ListenerPos[1] = ListenerPos[2] = 0.0f;
    ListenerOri[0] = 0.0f;
    ListenerOri[1] = 0.0f;
    ListenerOri[2] = -1.0f;
    ListenerOri[3] = 0.0f;
    ListenerOri[4] = 1.0f;
    ListenerOri[5] = 0.0f;
    alListenerfv(AL_POSITION, ListenerPos);
    alListenerfv(AL_ORIENTATION, ListenerOri);
    alGenBuffers(NUM, Buffers);
    Buffer[0]= alutCreateBufferFromFile("/Res/jungle.wav");
    err = alutGetError();
    alGenSources(NUm, Sources);
    alSourcei (Sources[0], AL_BUFFER, Buffers[0] );
    alSourcef (Sources[0], AL_REFERENCE_DISTANCE, 25*2);
    alSourcefv(Sources[0], AL_POSITION, SourcesPos);
    SourcesPos[0] = 200;
    SourcesPos[1] = 200;
    SourcesPos[2] = 25;
    alSourcefv(Sources[source], AL_POSITION, SourcesPos);
    alSourcePlay(Sources[source]);
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>
    I am expecting the sound to be played in the right headphone/speaker.
    But the sound is played in both the headphones.
    I used wave device and generated the output.wav file.
    In that file also the sound is played in both the headphones.
    I used the following settings for configuring OpenAL alsoft.conf.
    Someone please help me the error in the above code.
    Does OpenAL able to generate the right sound or left sound effect depending on the co ordinates
    format = AL_FORMAT_STEREO16
    cf_level = 0
    frequency = 44100
    refresh = 4096
    sources = 256
    stereodup = false
    drivers = osp // Our platform
    excludefx =
    layout_STEREO = fl=-90, fr=90
    layout_QUAD = # Sets the speaker layout when using quadriphonic output.
    # Available speakers are back-left(bl), front-left(fl),
    # front-right(fr), and back-right(br).
    # The default is:
    bl=-135, fl=-45, fr=45, br=135
    layout_51CHN = bl=-110, fl=-30, fc=0, fr=30, br=110
    layout_61CHN = sl=-90, fl=-30, fc=0, fr=30, sr=90, bc=180
    layout_71CHN = bl=-150, sl=-90, fl=-30, fc=0, fr=30, sr=90 br=150
    device = default
    periods = 0
    capture = default
    mmap = true
    [wave] # Wave File Writer stuff
    file = # Sets the filename of the wave file to write to. An empty name
    # Default is empty
    volume = 100
    Thanks
    Swaroop

    Hi,
    You might want to check out connect.creativelabs.com to see how they can help you.

  • Where is "Sound Effects" option in Iphone?

    On my ipod touch I have an option under "sounds" the "sound effects" and under that option I have 1.Speaker 2.Headphones.3 Both.............Where do I find these in iphone? Thanks

    From page 118 of http://manuals.info.apple.com/enUS/iPod_touch_3.1_UserGuide.pdf
    "Note: On the first-generation iPod touch, choose General > Sounds and select whether you want sound effects to play over the internal speaker, through the headphones, or both."

  • Adding a sound effect

    Now that I have several clips in the timeline, I want to add some sound effects. I want the sound effects to be timed to actions in the clip, and I want the background audio to mute when the sound effect plays. Guys, I am not laze--I have been searching and searching the electronic documentation and I cannot find what I need.
    Whichever is easier for you--can you tell me where to find this in the "manual," or can you explain how to do it?
    Thanks,
    Ben

    it sounds as if I have to manually make the adjustment for the background audio level to decrease when the sound effect is played.
    FCE provides a lot of control over all details of editing, but you have to give the correct "instructions" to do what you want.
    The basic point is that you must stack the "boing" sound below the audio clip that is linked to the video you captured (e.g. on track a3), move it right or left till the sound is synchronized with the bouncing ball and then listen to the result. You might not even need to lower the volume of the captured clip; what I suggested in my previous answer was for effects that had to substitute the original soundtrack. A "boing" might simply be on top of it. In any case it's up to you to make this decision. And if you decide you still want to lower the original volume you may follow my previous instructions.
    Just a note: if you use iMovie you have to do basically the same; not much difference in this case (in iMovie though you do not see the sound track linked to the captured clip, unless you explicitely Extract it).
    how make the sound effect happen at a specific time--picture putting a "boing" sound as a ball bounces. How do I do that?
    See above: just drag the "boing" clip right or left till you get syncronization. You may also set Show Audio Waveforms in the Timeline Options of the Sequence Settings (select the sequence and cmd-0) and the waveform of the boing may be of help in this operation.
    I hope this is clear
    Piero

  • Imported MP3 sound and image CD Bird pics and sounds but each song is an album, so cluttering my album and artist lists. How can I keep together as one album please?

    I Imported a MP3 sound and image CD Bird - Birds of Sri Lanka - via itunes on my mac, then synched content to my Iphone as a Playlist to get all the songs/pics in alpha order. BUT each of the 329 birdsongs are listing/appearing as a separate album, so cluttering my album and artist lists :0(
    How can I get all the Birds of Sri Lanka songs/albums to come together as just one album please?
    Do I need to delete what i have, and download again in another way? :0(
    Can I move them all the songs somehow so they become ONE ALBUM :0)
    Thank you
    BW

    OOOOhhhhhh no worries, sorted it.
    In playlist Selected all songs, went into Get info and updated COMPILATION field from NO to YES.
    :0)

  • Mp3 sounds bad on iphone

    I am new to iTunes and iPhone 4.
    I have an existing collection of cd's, that I did copy into MP3, while using 320kbits sampling rate (I only remember the number).
    If I listen to them, I can hear that the quality is a bit lessor then the original. But, I can live with it, as I will never listen to the MP3 on my hifi set.
    I did drag the MP3 out of explorer, into a iTunes folder, which seems to be coupled to my iPhone 4. That resulted in creating, more then one album per cd, but I found out how to repair that (lot of work).
    Then I started to listen on the iPhone with the apple headphone set.
    My first thought was, pretty clear, but... I miss something.
    I could not put a finger on it. So I plugged in my old Sony headset.
    It sounded better, but I was still missing things.
    Then I heard it.
    It sounded like the high tones and basses where cutoff.
    And there where the music should be very rich in detail, it sounded cluttered up.
    There where a violin stops playing, you normally here it fade out to 0, but now it stopped half way the fading process.
    Then I tried to listen through the PC speakers.
    I loaded iTunes and what seems to be, loading music from the iPhone and played via the speakers. Meanwhile I compared it, by listening to the original MP3, while using Windows Media Player 11.
    I could hear a huge difference. The music via Media Player was more open, No high tones or basses cutoff, no cluttered, but detail, and fading out, did not cutoff either.
    Via iTunes, I heard exactly, what I heard on my iPhone.
    Cutoff high and basses, no detail, all cluttered up, and cutoff fade outs.
    When I look under Info, it says that the MP3 was created at 320kbs.
    My question is, why has an MP3 get such a low quality on my iPhone?
    BTW, I did not change any settings in iTunes.

    I have just tried something out:
    I used iTunes. Made several MP3 with 320kbps setting, and the same numbers and settings for AAC.
    What I heard was, that the MP3 sounds a bit muffled when played in windows media player and iTunes.
    The AAC sounded a bit better then the MP3 with Windows Media player, but it sounded high pitched in itunes.
    I could here more detail with the cd.
    I listened to the Zauberflöte.
    Very odd, when put on the iPhone, I only see the numbers once. but which one?

  • Zen Xtra - low bitrate MP3s sound terri

    I download a lot of mp3 speeches, lectures, etc. - i.e., all spoken word stuff (as opposed to music). Many of these files are fairly low bitrate (6KBS) in order to minimize space and make the downloads go faster.
    These low bitrate mp3s play/sound fine when I play them on my computer (remember, we're talking spoken word, not music - I know 6KBS is too low for music to sound good). But, while they sound ok when played on my computer (in Windows Media Player), they sound like crap when I play them on my Zen Xtra (really slow and slurred speech, etc.)
    The problem is not my car cassette adaptor since the same thing happens when I use headphones.
    Is there anything I can do? I've never upgrade the firmware - might that help?
    Or, would re-encoding these at a higher bitrate help - recognizing that I don't have anything better to start with than the 6KBS file I started with?

    JimG90 wrote:
    Thanks for the good and prompt response. If I may follow up?
    I never installed CMS - did it come with my Zen Xtra? To install it now, do I need either to buy it or to find my original CD (which may be hard) or can I download and install it free from the support website as a Zen Xtra owner?
    I do have Windows Media Player and MusicMatch Jukebox Deluxe - will either of those do what CMS does?
    CMS would have come with the player on the installation CD but you can download it from the website. When you install it you need to install the drivers first, then connect your player so that when CMS installs it will see that you have a device that entitles you to load the program. Then load the Zen Xtra plugin for CMS.
    You can convert the files with WMP when you sync the files to your player - in the Sync settings there is a quality tab and you can choose to convert the files before transferring. I think it will only convert to WMAs though. If you have Copy Protect switched on in the WMP settings then the files will have DRM applied.
    PB

Maybe you are looking for