1. EuTalker

Below is a little program I use to read aloud any text copied and pasted 
from e-mail and web pages (like this forum). It uses the festival speech 
synthesizer. Perhaps someone will find it useful.

Irv.

include gtk2/wrapper.e

atom win, panel, scroller, tv, buf, btn

system(sprintf("echo \"%s\" | festival --tts",{text}),0)
end procedure

Say(get(buf,"Text"))
set(buf,"Text","")
return NULL
end function
constant talk = call_back(routine_id("Talk"))

-------------------[ MAIN ]----------------------

win = window("Festival Speech Synth")
set(win,"Size",{300,200})
set(win,"Border",10)

panel = vbox(0,0)
addto(win,panel)

scroller = scrolled_window(0,0)
addto(panel,scroller)

tv = text_view()
set(tv,"Wrap Mode",2)
set(tv,"Left Margin",5)
set(tv,"Right Margin",5)
addto(scroller,tv)
buf = get(tv,"Buffer")

btn = button("gtk-ok")
pack(panel,-btn,0,0,0)
when(btn,"clicked",talk,0)

show(win)
main()

new topic     » topic index » view message » categorize

2. Re: EuTalker

Well, it appears that somewhere along the line, lines following a 
comment were removed. Let me try again. Hey, Rob, what happened to 
syntax coloring?

include gtk2/wrapper.e

atom win, panel, scroller, tv, buf, btn

procedure Say(sequence text)
 system(sprintf("echo \"%s\" | festival --tts &",{text}),0)
end procedure

function Talk()
 Say(get(buf,"Text"))
 set(buf,"Text","")
 return NULL
end function
constant talk = call_back(routine_id("Talk"))

win = window("Festival Speech Synth")
set(win,"Size",{300,200})
set(win,"Border",10)

panel = vbox(0,0)
addto(win,panel)

scroller = scrolled_window(0,0)
addto(panel,scroller)

tv = text_view()
set(tv,"Wrap Mode",2)
set(tv,"Left Margin",5)
set(tv,"Right Margin",5)
addto(scroller,tv)
buf = get(tv,"Buffer")

btn = button("gtk-ok")
pack(panel,-btn,0,0,0)
when(btn,"clicked",talk,0)

show(win)
main()

new topic     » goto parent     » topic index » view message » categorize

3. Re: EuTalker

Irv,

I'm not sure, but I think maybe you have to enclose code between:

-- and


Dan Moyer

----- Original Message ----- 
From: "irv mullins" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Thursday, April 22, 2004 9:13 PM
Subject: Re: EuTalker


> 
> 
> posted by: irv mullins <irvm at ellijay.com>
> 
> Well, it appears that somewhere along the line, lines following a 
> comment were removed. Let me try again. Hey, Rob, what happened to 
> syntax coloring?
> 
> include gtk2/wrapper.e
> 
> atom win, panel, scroller, tv, buf, btn
> 
> procedure Say(sequence text)
>  system(sprintf("echo \"%s\" | festival --tts &",{text}),0)
> end procedure
> 
> function Talk()
>  Say(get(buf,"Text"))
>  set(buf,"Text","")
>  return NULL
> end function
> constant talk = call_back(routine_id("Talk"))
> 
> win = window("Festival Speech Synth")
> set(win,"Size",{300,200})
> set(win,"Border",10)
> 
> panel = vbox(0,0)
> addto(win,panel)
> 
> scroller = scrolled_window(0,0)
> addto(panel,scroller)
> 
> tv = text_view()
> set(tv,"Wrap Mode",2)
> set(tv,"Left Margin",5)
> set(tv,"Right Margin",5)
> addto(scroller,tv)
> buf = get(tv,"Buffer")
> 
> btn = button("gtk-ok")
> pack(panel,-btn,0,0,0)
> when(btn,"clicked",talk,0)
> 
> show(win)
> main()
> 
> 
> 
> For Topica's complete suite of email marketing solutions visit:
> http://www.topica.com/?p=TEXFOOTER

new topic     » goto parent     » topic index » view message » categorize

4. Re: EuTalker

Foolish Dan! :)

Irv,
you have to put code that you want syntax colored in between a couple of
tags, which *don't* show up in the forum, so if you looked at my previous
reply it looked like nonsense!  (they do show up in email from Topica).

Those tags would be:
less-than symbol followed by "eu code" without the space and without the
quotes, followed by greater than symbol; same with slash before the word for
end code.

similar to this:
<fucode>
--replace the fu with eu

</fucode>

Dan



----- Original Message ----- 
From: "Dan Moyer" <DANIELMOYER at prodigy.net>
To: <EUforum at topica.com>
Sent: Friday, April 23, 2004 12:28 AM
Subject: Re: EuTalker


>
>
> Irv,
>
> I'm not sure, but I think maybe you have to enclose code between:
>
> }}}
<eucode>
>
> -- and
>
> </eucode>
{{{

>
> Dan Moyer
>
> ----- Original Message ----- 
> From: "irv mullins" <guest at RapidEuphoria.com>
> To: <EUforum at topica.com>
> Sent: Thursday, April 22, 2004 9:13 PM
> Subject: Re: EuTalker
>
>
> > posted by: irv mullins <irvm at ellijay.com>
> >
> > Well, it appears that somewhere along the line, lines following a
> > comment were removed. Let me try again. Hey, Rob, what happened to
> > syntax coloring?
> >
> > include gtk2/wrapper.e
> >
> > atom win, panel, scroller, tv, buf, btn
> >
> > procedure Say(sequence text)
> >  system(sprintf("echo \"%s\" | festival --tts &",{text}),0)
> > end procedure
> >
> > function Talk()
> >  Say(get(buf,"Text"))
> >  set(buf,"Text","")
> >  return NULL
> > end function
> > constant talk = call_back(routine_id("Talk"))
> >
> > win = window("Festival Speech Synth")
> > set(win,"Size",{300,200})
> > set(win,"Border",10)
> >
> > panel = vbox(0,0)
> > addto(win,panel)
> >
> > scroller = scrolled_window(0,0)
> > addto(panel,scroller)
> >
> > tv = text_view()
> > set(tv,"Wrap Mode",2)
> > set(tv,"Left Margin",5)
> > set(tv,"Right Margin",5)
> > addto(scroller,tv)
> > buf = get(tv,"Buffer")
> >
> > btn = button("gtk-ok")
> > pack(panel,-btn,0,0,0)
> > when(btn,"clicked",talk,0)
> >
> > show(win)
> > main()
> >
> >
> > For Topica's complete suite of email marketing solutions visit:
> > http://www.topica.com/?p=TEXFOOTER
>
>
>
> For Topica's complete suite of email marketing solutions visit:
> http://www.topica.com/?p=TEXFOOTER
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu