Code to Click and Play Sound in HTML5

Hi,
I’m creating an Animated Digital Children’s Book.  I am using Edge Animate for the presentation for viewing on Tablets and IPads.  I want to add audio .wav or .mp3 sound affects to predefined buttons “Button1, Button2…Button16” that will play when the buttons are clicked.  I know there are several ways of doing this, but the code I have tried doesn’t work or I don’t understand it.  It would be nice to have a few interactive sound affects since the product is for kids.  Does anyone have or know HTML5 or Javascript code that will work if placed in Dreamweaver?  Other suggestions are welcomed!
G. Hardy

Well, since it's a  site for kids...
http://www.javascriptkit.com/script/script2/soundlink.shtml
Keep in mind, you need two file types to cover all browsers (MP3 and either Ogg or Wav). Also, this will likely only work when you preview in browser not in Design or Live View depending on your version of DW.
Also keep in mind that most visitors online get extremely annoyed by this type of functionality. On a site meant for adults to visit, browse and purchase goods (possibly at work), this would need at minimum a large "sound off" button that would disable all sound. Also, don't rely on the sound to tell the viewer what's happening. Some visitors won't have sound (no speakers), won't want sound (speakers turned off) or could be deaf (accessibility issues).

Similar Messages

  • Lost Mode and Play Sound are "Pending."  However, iCloud indicates that it connected and backed up to iCloud at a date that is 1 week after it went missing.  How is this possible without locking (Lost Mode Pending an internet connection)

    Hi,
    My wife lost her iPhone two weeks ago while on vacation in London (cell service inoperative in foreign country).  Using Find My iPhone app on my device, I activated Lost Mode and Play Sound.  However, both are listed as "Pending," since it those actions require the phone to connect to the internet (wifi only due to no cellular data coverage.).
    We recently returned home and purchased a new iPhone.
    However, when looking to restore the apps/settings from her old phone using a previous iCloud backup, iCloud indicates that the old phone connected to iCloud and backed up the original phone at a date that is 1 week after it went missing.  How is this possible without locking (Lost Mode Pending an internet connection)?
    If the phone was activated and connected to the internet via a wifi signal, shouldn't it immedately lock, show up on the map, Play Sound, and send me an email that the phone has been found?
    I also read somewhere that if running iOS 7, the iCloud website interface enables you to track previous locations, for instance if the phone moves from wifi hotspot to hotspot.  Is that true?  If so, how do I do that?
    Thank you for your time, and have a great day!
    Sincerely,
    - Matt

    just giving this a wee bump as time is of the essence here and i need advice/ answers quick!
    apologies if i've broke any rules!
    alex

  • Uploaded my pictures from my iPhone to my MacBook- Some of the videos I made show that they imported and play sound, but no picture- are they gone?

    I Uploaded my pictures from my iPhone to my MacBook… Some of the videos I made show that they imported and play sound, but no picture… are they gone?Becuase they offer to delete what was imported, so to save space i did... Is there anything I can do to restore the picture?

    Do your videos play in QuickTime Playerwhen you reveal one of them in the Finder with "File > Reveal > Original"? Try to open the revealed movie in QuickTime and see if it plays.
    Check the format of the movie. You can see it in the Inspector in QuickTime Player from the "WIndow" menu: Window > Show Inspector.
    iPhoto does not support all movie formats and codecs that QuickTime player can play, and not all frame rates.
    See: Using AVCHD video with iPhoto '11
    If the movie does not play in QuickTime Player either, install QuickTime 7 for more codecs.

  • Lost Clicking and Typing Sounds when Published

    Hello,
    In the preview of my videos, I could hear both the audio I recorded and the automatic clicking and typing sounds from the mouse and keyboard actions.  One I publish my videos, I lose the clicking and typing sounds.  How do I get them back?

    Hi there
    It may depend on your version of Captivate. Assuming version 4, if you click Edit > Preferences... and look at the Preferences dialog, are the options enabled?
    Click the image below for full size view.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Record and play sound in SWF

    Hi List,
    I have developed standalone applications wherby i want the
    give the
    user an option of recording voice and then replaying the
    recorded
    sound. No need to save a file. Just record and listen.
    Is it possible to record and play sound in Flash swf-files
    without the Flash Communication Server?
    If not is there any third party component which can help me
    solve this purpose?

    No, don't think this is possible without Flash Media
    (formerly Communication) Server.
    Search these forums though. The question is asked pretty
    often, so maybe someone has offered a different answer.
    Cheers!

  • Keyboard clicks and lock sounds are off even though the settings show them as "on". How can I get them back?

    Keyboard clicks and lock sounds are off even though the settings show them as "on". How to get them back?

    Use the volume buttons on the side of the phone.  Personally, I find it's better with those off completely.

  • How to fix keyboard clicks and lock sounds when they are on in setting , sounds and still do not work?

    How to fix keyboard clicks and lock sounds when they are on in setting , sounds and still do not work?

    Double-click the Home button and swipe the Task Bar to the right. Check Volume and Mute Settings.
    Message was edited by: Diavonex

  • Control click and lock sounds independently of ringer?

    Ever noticed how loud keyboard clicks and screen lock sounds can be in elevators and quiet spaces?
    I am looking for a way to have quiet (but not silent) keyboard clicks and lock sounds, while keeping the phone ringer as loud as possible so that I can hear it when it is in my pocket.
    I tried everything I could think of, without success: It appears that clicks and lock sounds are always at the same volume as the ringer.
    One solution would be to turn these clicks and lock sounds off completely, but I would miss them in everyday use. The other is to do what I do now, which is to reduce the overall volume when I am inside, and put it back to the max when outside - but it is a hassle.
    Any solution?
    Thank you.
    PS: Bonus question: Can Siri be automatically silenced when the mute lock is on? I know that one can silent it when the Siri microphone comes up, but you have to also change this every time you want it back to respond. I had embarrassing/disturbing Siri prompts happen by accidentally holding the home button too long while on mute mode.

    Do you turn those sounds? I like the keyboard click sound but it just sound inconsistent and it's annoying...

  • Recording and playing sound

    I am having a problem with sound in my program, it takes information from a TargetDataLine, put's it in a temporary file, then takes it back out of the temporary file and plays it using a SourceDataLine. currently, it does not play back the sound source code will follow in my next two posts.
    andrewjj20

    the play method:
    class Player implements Runnable {
    public Player() {
    public void run() {
    try {
    int bufferSize = (int)(format.getFrameSize()*rate*1);
    byte[] bytes = new byte[(int)bufferSize/12];
    lineOut.open(format,bufferSize);
    stopS = false;
    recording = false;
    playing = true;
    if (debug) {
    print("playing");
    status.setText("Playing");
    lineOut.start();
    while (!stopS) {
    if (in.available() != 0) {
         if(lineOut.available() != 0) {
         in.read(bytes);
         lineOut.write(bytes, 0, bytes.length);
    } else {
    stopS = true;
         resetGUI();
    lineOut.drain();
    lineOut.stop();
    lineOut.close();
    lineOut = null;
    stopS = false;
    recording = false;
    playing = false;
    status.setText("Done");
    if (debug) {
    print("Done");
    } catch (LineUnavailableException ex) {
    error("I can't acces the nessesary audio functions now");
    } catch (IOException ex) {
    error("Error communicating with the file.\nABORT!!! ABORT!!! ABORT!!!");
    }

  • How to diminish latency when clicking and playing a track?

    I´m currently working on a play as the sound technician, and I have to play sound on certain cues. The other day, at a rehearsal, my mac froze, second time it´s happened (though it didn´t really freeze because I hit a few keys and a little ¨quit window¨ popped up, I think about force quit, but I couldn´t move the cursor). I rebooted, and when I started playing the tracks from the itunes library, there´s occasionally more latency in playing the track when I double click it, and that´s kind of a little problem seeing as I have to play the sounds on cue! I uninstalled itunes, and reinstalled, but to no avail.  Any ideas? Thanks guys!
    P.S. If you guys know of any other ideas that I could try as well, I´m all ears!

    Try leaving the OnStart at false
    Change the Start property (under data) to ThisItem!IsSelected
    Sorry for not being clearer.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This is beneficial to other community members reading the thread. -Bruton
    Maybe it is me, but that doesn't work for me.
    I don't want the first video in the gallery to auto start
    I want to be able to manually start the first video and NOT have to manually stop it and go to another video in the gallery, tap/click play and have that first video stop then and the new one start.
    If I set the Data OnStart to it autostarts the first item. If I go to the next item and press play, the first item continues, so I end up with both playing.
    so the setup below does not work.
    what am I missing?
    -- Barb Bowman

  • 1120 error when attempting to load and play sounds

    I'm attempting to load and play a sound (which seems quite
    basic) but I am getting an 1120 error. Could anyone please help me
    figure out what I'm doing wrong?
    var hitSound:Sound = new Sound();
    var reqHitSound:URLRequest = new URLRequest("myAudio.mp3");
    hitSound.load(reqHitSound);
    hitSound.play();
    1120: Access of undefined property hitSound
    1120: Access of undefined property reqHitSound

    Yes, the mp3 is good and the path is correct. I'll put my
    complete code below.
    The error I get is:
    1120: Access of undefined property hitSound. (line 14 -
    hitSound.load(reqHitSound);)
    1120: Access of undefined property reqHitSound. (line 14 -
    hitSound.load(reqHitSound);)
    1120: Access of undefined property hitSound. (line 15 -
    hitSound.play();)
    Its almost like the code doesn't feel I've really defined
    hitSound as a Sound.
    Help please? Am I missing a component?

  • Can I Dynamically Link and Play Sounds?

    I am building a morse code training program for my Ham Radio
    Club. I am wondering how to script the code that would allow the
    user to type (via a virtual keyboard on the program interface) a
    sentence, linking each dynamically selected letter to a sound file
    (MP3), and then play the setence in morse code when the play button
    is selected? Displaying the typed text in a dynamic window is the
    easy part, but linking each selected letter to a sound file, and
    playing them in sequence is where I am stuck.
    I cannot find any help for this type of script via manuals
    and help files. Thank you in advance for your help.
    Sincerely,
    David, WD8PUO

    if you are going to encode punctuation, in addtion to
    alpha-numeric characters you should probably invest the time to
    create an associative array. i'll explain that if that's the route
    you take.
    in any case, you'll want to import into your library as the
    character sound files that you'll need. you'll want to give each a
    linkage id and you'll want to pick this wisely to ease your work
    later.
    you'll want to use the onChanged property of your input
    textfield to store all the linkage ids (this where the associative
    array would be used and/or your clever choices used in assigning
    linkage ids) in an array.
    you'll create a sound object from the flash sound class. when
    the submit button is pressed you'll initialize the index of your
    array that contains your linkage ids, you'll attach the
    corresponding sound and apply the start() method of your sound
    object.
    you'll create an onSoundComplete method for your sound object
    (and you'll probably want small delay in executing this next step
    so there's some silence between characters) where you'll increment
    your index and attach the corresponding sound and start it.
    you are done.
    don't forget to include a sound that corresponds to a blank
    space. ie, silence for some amount time to indicate a new
    word.

  • Recording and playing sound input from mic simultaneously in iphone/ipad

    I want to simultaneously record and play the sound from a mic in iphone. As thecricket commentory application.
    Please provide me a solution for this.
    Is this possible in iOs.

    This probably isn't going to sound very helpful, for which I apologise in advance, but I'm afraid it's the truth...
    The only way you stand any way of doing any of this is by using ASIO4ALL, which can aggregate different drivers from multiple devices. But I don't rate your chances too highly, I'm afraid - USB mics have long been the problem child of computer-based audio. On top of that, you are trying to get sounds in and out of a separate device at the same time - not only that, but it's a Creative Labs gamer's device and they are second only to USB mics in terms of the 'difficult' stakes - search this forum!
    A much, much better way to attempt to do this would be to use a sensible ASIO external device with sufficient inputs, and a mic that plugs into it, not a USB one. That way you could route the inputs and outputs appropriately, and use the device's monitoring so that you could monitor what you need to. I wouldn't attempt to do anything like this any other way, I'm afraid. Another approach (which can be made to work well) is to use an external mixer to do most of the work - often it's easier to set up the monitoring on these. You can get mixers with the appropriate interface built-in, and they don't cost a fortune either. Mackie and Behringer make suitable devices.

  • Keyboard clicks and lock sounds have quit

    The keyboard clicks and the lock sound have quit working on my phone today. I have rebooted the phone and that didn't fix it. Has this happened to anyone else?

    Do you have the ring/silent switch on? See the top left side of your phone. Is the red dot showing?

  • Audible click when playing sounds

    For a few months now, I've had an FiiO Olympus E-10 USB headphone amp. The reason for getting it was convenience; it allows me to just unplug the Thunderbolt cable from my MacBook Air and leave my headphones hooked up to the Thunderbolt Display through the E-10. The audio quality is actually quite good, but for some reason I get an audible click every time audio stops.
    When a system sound has finished playing, there is a click
    When I pause a YouTube video or when it ends, there is a click
    When I play music from iTunes and a track pauses or ends, there is a click.
    It's really quite annoying.
    Additional data points :
    When I have the headphones connected to my audio jack on the MBA, the click does not happen.
    When I have another pair of headphones connected to the E-10, the click also happens.
    No specific drivers were installed to support the device. None are available on the manufacturers site either.
    In my view, all of the above appears to point towards a hardware issue.
    Any similar experience?
    Any thoughts on how to resolve it without buying a new device?

    Is this click coming from your speakers, whether the built-ins or attached? I ask because most of us seem to get a click or pop when the Mac wakes from sleep, etc. Isn't all that loud on my system and doesn't bother me, but some folks really dislike it and have mentioned it (read moaned & complained) extensively in the past. Seems like maybe the sound chip or something 1st powering up.

Maybe you are looking for

  • Snapping is stuck "ON" in FCPX

    Hi! Although I have snapping disabled, I can't trim my clips to a specific timing. The snap function seems to be active even though the "snap tool" isn't highlighted. Every time I try and trim a clip, it snaps to the grid. (Hopefully I'm explaining t

  • Coherence MasterMemberSet autoIncrement after updating a running EAR file

    Hi All, I have a EAR application file, which uses coherence 3.6.0.4. We have a requirement to deploy a new version of application, with out down time and hence "update" feature of EAR deployment. When we deploy the new application by selecting the ne

  • Customizing F-keys in photoshop 7

    I have been able in previous versions of photoshop to customize F-keys so that I could make crops, change dimensions, etc. much faster. I cannot find a way to do it in photoshop 7 nor was I able to find anything about it either in photoshop help, or

  • ITunes can't "read" my ipod nano

    So, I got an ipod nano for Christmas. I've already got a bunch of songs in my library because I used to have a different ipod. But eveytime I try to plug in my nano, a little bubble pops up and says, "iTunes cannot read ipod 'J:/'." and then it tells

  • My dock is somehow broken!

    My macbook is running wonderfully, BUT my dock is all messed up. Some of the icons for my open applications are in the dock, and some aren't. What's annoying is that the icons also vanish from alt-tab, and I use alt-tab all the time to go from one ap