How can I easily make a jpeg image speak?

Larry September 4, 2011

So I have 20 or so cars on a website and I would like each of them to say (using text to speech) something different when visitors click on each of them. My expertise is limited so I’m looking for solution that will be easy to utilize.

  1. Adman Blufftonsun
    September 5, 2011 at 11:05 am

    Thanks for taking the time to answer my question and the excellent advice.  So maybe embedding a small sound player beneath each image is the way to go.  Would a small sound player accommodate "text to speech" messages and before I start searching for one, does anyone know where I can get one.  Or is it easier and more effective to go Jeffrey's route and put a player button adjacent to the picture that can be clicked.  Since I'm just beginning to learn some coding, I am interested in the easier solution.  By the way, Jeffrey mentioned something about a Java progammer doing the code for free, but I am thinking tnat I would be more comfortabe paying someone to do it. Good for the economy and people should get paid for their expertise.

    • Tina
      September 5, 2011 at 6:49 pm


      if you are willing to pay for a proper solution, I recommend that you post a project on a website like Elance or Guru. I recommend to follow the instructions in this article:

  2. James Bruce
    September 5, 2011 at 8:24 am

    It is quite possible using javascript as jeffery eluded to. 

    Here's an a page with code snippet you can use, but you'll need to be comfortable editing HTML:

    However, I would actually warn against doing anything like you're describing, as it takes us back to a time of random midi files playing on page load, flashing gifs and Geocities... I would personally consider it bad practice for a general web design (though as an art project or something, fine), since it's not the expected behaviour. Instead what I would do would be to embed a small sound player beneath each photograph, and encourage users to click play to hear more - or just make the whole thing a video. If I click a picture, it's because it's a link to another page, or I want a full size picture- not some sound file to play. So, basically it goes against user interface design principles. 

  3. Anonymous
    September 4, 2011 at 10:01 am

    adding sound to a jpeg. Its not possible unless its like the others have said. Using Flash or a flash type program, create a html page with the jpeg and the sound file incorporated into it.

    create flash animations, then add the picture and the sound and save it as an .exe or .swf file


  4. Jeffery Fabish
    September 4, 2011 at 10:01 am

    Hi Larry,

    JPEG's are only images and do not harness audio capability. However, if you have audiofiles already, you can use Javascript's "onClick" function to play audio when the image is clicked. Add the function call to the image, such as You will need to declare a few variables which reference the path of the audio file, then on the "playAudio" function just call, use a loop to randomly call a variable (which would play the audio).

    If coding isn't your thing, you probably get a Javascript programmer to do this for free, it's fairly simple. Of course, without seeing the source code I'm unable to actually help you.

    W3Schools - JavaScript Tutorial - JavasScript Tutorial
    Tizag - Javascript Tutorial