AutoHotkey Community

It is currently May 27th, 2012, 12:18 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Text to Talk
PostPosted: May 24th, 2005, 7:34 pm 
Offline

Joined: December 16th, 2004, 11:45 pm
Posts: 89
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)

Code:
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

_________________
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..."


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Cool
PostPosted: May 24th, 2005, 10:42 pm 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
Cool! Nice workaround!

Skrommel


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 25th, 2005, 6:22 pm 
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:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 26th, 2005, 10:38 am 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2005, 7:17 pm 
Offline

Joined: February 14th, 2005, 10:54 am
Posts: 447
Location: Texas, Usa
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 :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 27th, 2005, 9:15 pm 
Offline

Joined: April 7th, 2004, 2:43 pm
Posts: 62
Yes they were $35.


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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 28th, 2005, 5:38 am 
Offline

Joined: September 7th, 2004, 9:20 pm
Posts: 275
Location: France
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 ?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 15th, 2005, 9:59 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2005, 12:24 am 
Offline

Joined: August 24th, 2005, 5:17 pm
Posts: 1237
@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.

Code:
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Very Nice
PostPosted: November 29th, 2005, 5:08 am 
Nice work, very cool. A nice trick is to add:

Run, (notepad or other program)
Sleep, 3000
^V


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2005, 11:01 pm 
My version to alter the selected voice.

Code:
#1::
TXT := "Something I want to say"

Speak:
TEMPFILE = %TEMP%\TALK.vbs
IfExist, %TEMPFILE%
   FileDelete, %TEMPFILE%
   FileAppend,
   (
Dim Talk
Set Talk = WScript.CreateObject("SAPI.SpVoice")
Set Talk.voice = Talk.GetVoices("Name=Audrey16", "Language=809").Item(0)
Talk.Speak "%TXT%"
), %TEMPFILE%
RunWait, %TEMPFILE%
FileDelete, %TEMPFILE%
Return


in this case the UK voice Audrey16


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2005, 11:10 pm 
Offline

Joined: December 14th, 2005, 3:08 pm
Posts: 219
I should have said that you get the voice name and language number from the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\

ATT-DT-14-Audrey16
in this case.

Look in a voice Token and see what the Name and Language strings are and use these.
809 is UK english.

_________________
Stuart Halliday


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2005, 9:41 pm 
Offline

Joined: November 18th, 2005, 11:18 pm
Posts: 25
Location: Germany
Quote:
Dim Talk`nSet Talk = WScript.CreateObject("SAPI.SpVoice")`nTalk.Speak "%TXT%"


is it possible to do this with AHK-internal commands too ???

_________________
greets Grendel


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2005, 10:53 pm 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
Grendel wrote:
Quote:
Dim Talk`nSet Talk = WScript.CreateObject("SAPI.SpVoice")`nTalk.Speak "%TXT%"


is it possible to do this with AHK-internal commands too ???



Not yet. SAPI is accessed through a COM interface.

This cannot be done in a straightforward manner with existing AHk capabilities.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2005, 2:42 am 
Offline

Joined: December 30th, 2005, 2:13 am
Posts: 4
Why there is error when i press talk? :(
I am using 1.0.37 ver


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, Yahoo [Bot] and 6 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group