If all you are looking to do is have something read out the text, then you
can think about using the google Text to Speech engine.

http://weston.ruter.net/projects/google-tts/

On Sun, Mar 6, 2011 at 1:37 AM, Bryce <brycemcr...@gmail.com> wrote:

> Hello,
>
> I'm looking for some help on how to add a sound effect to my current
> javascript. I'm using a simple array of quotes to generate a new quote
> each time a button is clicked. I'd like to also have an audio clip of
> the quote to play in accordance with the text of the quote being
> displayed. I'm a noob so I have no idea how to accomplish this. Any
> help is greatly appreciated!
>
> Here's the basic structure of what I'm using now.
>
> var pullQuote = new Array(5);
>
> var randomNumber = Math.floor(Math.random() * 5);
>
> pullQuote[ 0] =  "I like Internet Scripting, but it is very hard and
> sometimes makes my brain hurt!";
> pullQuote[ 1] =  "Internet Scripting is the best course in the DMT
> program!";
> pullQuote[ 2] =  "Learning JavaScript will help me become a better web
> designer!";
> pullQuote[ 3] =  "I think JavaScript is for the monkeys!";
> pullQuote[ 4] =  "JavaScript makes me go loopy!";
>
> var quote = document.getElementById('quote');
>
> quote.innerHTML = (pullQuote[randomNumber]);
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/jsmentors@jsmentors.com/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/jsmentors@googlegroups.com/
>
> To unsubscribe from this group, send email to
> jsmentors+unsubscr...@googlegroups.com
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to