Point at which speaking is stopped?

Mike Bonner bonnmike at gmail.com
Mon Dec 26 18:48:12 EST 2011


Might watch the code I used to toggle on and off (assuming you used that
part) Not sure that portion is thought out very well, and as you say things
will crop up, but glad its working well enough as a starting point that you
can tweak to fit your needs.

Hope your new year is a good one!

On Mon, Dec 26, 2011 at 4:41 PM, Jim Hurley <jhurley0305 at sbcglobal.net>wrote:

> Mike,
>
> Ingenious. Works like a charm. Thank you.
>
> There will be problems, as I have discovered in an other app I am working
> on in parsing sentences. The period has multiple uses besides a sentence
> delimiter, for example in abbreviations and in decimal numbers. These can
> be parsed out however.
>
> Thanks again, vert nice,
>
> Jim Hurley
>
>
> I have put my Text to Speech app up on the web:
>
> go url "http://jamesphurley.com/TextToSpeech.livecode"
>
>
>
>
> >
> >
> > Mike Bonner wrote:
> >
> > Yep, in simplest form its not to bad.  I put a bunch of text into a field
> > then to read it, set the itemdelimter to "."  put the field text into a
> > variable and replaced "? " with ?. " same with "! " replaced with "!. "
> (to
> > ensure we still retain punctuation tone changes)
> >
> > So the following script placed in a button will read from field 1.
> Clicking
> > the button again pauses, Reading picks up where it left off.
> >
> > local tReading, tCurrLine, tTotalLines,tText
> > on mouseUp
> >    if tReading is empty then put false into tReading
> >    put not tReading into tReading
> >    set the label of me to "Reading: " & tReading
> >    startLooping
> > end mouseUp
> >
> > command startLooping
> >    set the linedelimiter to "."
> >    if tReading then
> >       if tCurrLine is empty then
> >          put field 1 into tText
> >          replace "? " with "?. " in tText
> >          replace "! " with "!. " in tText
> >          put the number of lines in tText into tTotalLines
> >          put 1 into tCurrLine
> >       end if
> >
> >       if not revIsSpeaking() then
> >          revspeak line tCurrLine of tText
> >          if tCurrLine = tTotalLines then
> >             put false into tReading
> >             put empty into tCurrLine
> >          else
> >             add 1 to tCurrLine
> >          end if
> >       end if
> >       set the label of me to "Reading: " & tReading
> >       send startLooping to me in 20 milliseconds
> >    end if
> > end startLooping
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list