Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Text to Talk


  • Please log in to reply
8 replies to this topic
Pasukun
  • Members
  • 91 posts
  • Last active: Jun 27 2014 02:14 PM
  • Joined: 16 Dec 2004
I don't know if there is one already in exist, but I thought this was so cool that I had to make one for AHK. :)
(Credit to El-Trucha from Autoit3)

Gui, Show, w300 h100, Text to Talk
Gui, Add, Text, x5 y5 w30 h20, Text:
Gui, Add, Edit, vTXT x40 y5 w245 R4,Type text in here, And Press TALK.
Gui, Add, Button, w60 h20, TALK
return

GuiClose:
ExitApp

ButtonTALK:
Gui, Submit, NoHide
TEMPFILE = %TEMP%\TALK.vbs
IfExist, %TEMPFILE%
	FileDelete, %TEMPFILE%
FileAppend, Dim Talk`nSet Talk = WScript.CreateObject("SAPI.SpVoice")`nTalk.Speak "%TXT%", %TEMPFILE%
RunWait, %TEMPFILE%
FileDelete, %TEMPFILE%
Return

Posted Image
"the things we touch have no permanence. my master would say: there is nothing we can hold onto in this world.. only by letting go can we truly possess what is real..."

skrommel
  • Members
  • 193 posts
  • Last active: Jun 07 2010 08:30 AM
  • Joined: 30 Jul 2004
Cool! Nice workaround!

Skrommel

  • Guests
  • Last active:
  • Joined: --
Really cool! :D

But I hate talking computers, so I type in "shut up" and click the talk button and it tells me to shut up. I type in "stop it" and it tells me to stop it. So, I smash the computer and all is well. :lol:

Jimmy2Times
  • Members
  • 65 posts
  • Last active: Jul 15 2014 07:56 PM
  • Joined: 07 Apr 2004
WOW!

How did you know about this command?

WScript.CreateObject("SAPI.SpVoice")

P.S. I recently got the AT&T Natural Voices and sounds almost like a human

Invalid User
  • Members
  • 447 posts
  • Last active: Mar 27 2012 01:04 PM
  • Joined: 14 Feb 2005
Did you have to pay for the AT&T voices? I would love a copy of them, I was playing around at the site. They are great.
my lame sig :)

Jimmy2Times
  • Members
  • 65 posts
  • Last active: Jul 15 2014 07:56 PM
  • Joined: 07 Apr 2004
Yes they were $35.


By the way, the Text to Talk script crashes IF you have a linefeed in your input text

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004
Thanks Pasukun for this very interresting code. Is there a way to choose the "nationality" of the voice ? The english prononciation is very funy on a french sentence... Is it the MS agent speech utility witch is used ? Or someting else that accepts other languages than english ?

Spacedog
  • Guests
  • Last active:
  • Joined: --
How can you get a script to say something predetermined in the script. So you would not need any text entry or hitting the button required.

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
@Spacedog: I was using this code in one of my scripts - the first line went at the top of my script and then I called the "Speak:" section with a timer, but you could also use Gosub.

TXT := "Something I want to say"

Speak:
TEMPFILE = %TEMP%\TALK.vbs 
IfExist, %TEMPFILE% 
   FileDelete, %TEMPFILE% 
FileAppend, Dim Talk`nSet Talk = WScript.CreateObject("SAPI.SpVoice")`nTalk.Speak "%TXT%", %TEMPFILE% 
RunWait, %TEMPFILE% 
FileDelete, %TEMPFILE% 
Return