EuTalker
- Posted by irv mullins <irvm at ellijay.com> Apr 23, 2004
- 564 views
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()