[Gambas-user] Text to Speech

Pablo Vera pvera at ...729...
Thu Dec 7 23:02:40 CET 2006


You should do it like this:

   DIM StringX AS String
   StringX = textbox1.text
   SHELL "echo " & StringX & "| festival --tts"


Pablo
__________________________________________________________

Tony Sales wrote:
> I would like to thank Stefano and Timothy for their replies to my query
> regarding calling text to speech from within Gambas. 
> 
> Stafano's suggestion of using the shell was quite straight-forward!
> 
> the line: 
> SHELL "echo hello world| festival --tts" 
> read out the string "hello world" 
> and the line: 
> SHELL "festival --tts textfile" 
> read out the contents of the text file  "textfile"!
> 
> However I was unable to pass a string from gambas to the shell. 
> 
> I tried:
> DIM StringX AS String
> StringX = textbox1.text
> SHELL "echo StringX| festival --tts"
> but this just read out "StringX" as a string
> 
> Is there an easy way to pass variables to the shell?
> 
> Secondly, this method calls festival anew each time, is there a way of
> starting festival and keeping it running in the background and sending
> text to it?
> 
> I presume this would involve calling festival-server and then using
> festival-client calls to send the text?
> 
> Timothy sent me two complete sample applications written in Gambas, one
> of which will run on my version of Gambas (I can read the code of but
> not run the other one). The sample program calls the KDE speech manager
> using DCOP and reads out text. This works really well, but is obviously
> designed for the KDE desktop (although it works with Gnome). This has
> plenty of sample code to get me started. I will first try to modify the
> existing code - probably by adding speech to the navigation of the
> program itself. Ideally I want a way of calling festival directly in
> Gnome without having to use the KDE speech manager as a middle-man! I
> presume this would have to be done using DBUS rather than DCOP which is
> designed for the KDE desktop environment.
> 
> Again I would welcome any advice and or suggestions as to how this might
> be achieved. My ultimate ambition is to build a suite of talking office
> applications - e-mail, word-processor, internet browser and file manager
> which do not rely on a third-party screen-reader. The idea being that I
> could then create a customised Ubuntu CD on which this suite would start
> up automatically for my blind and partially sighted students!
> 
> Thanks for all the useful help and advice, I really appreciate people
> taking the time to share their knowledge with people like myself who are
> just trying to make the 'final leap of faith' into Linux!
> 
> drbongo
> 
> 
> 
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 




More information about the User mailing list