AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Text to Talk
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Pasukun



Joined: 16 Dec 2004
Posts: 84

PostPosted: Tue May 24, 2005 7:34 pm    Post subject: Text to Talk Reply with quote

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. Smile
(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

_________________

"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..."
Back to top
View user's profile Send private message
skrommel



Joined: 30 Jul 2004
Posts: 180

PostPosted: Tue May 24, 2005 10:42 pm    Post subject: Cool Reply with quote

Cool! Nice workaround!

Skrommel
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed May 25, 2005 6:22 pm    Post subject: Reply with quote

Really cool! Very Happy

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. Laughing
Back to top
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Thu May 26, 2005 10:38 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Fri May 27, 2005 7:17 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Payam



Joined: 07 Apr 2004
Posts: 58

PostPosted: Fri May 27, 2005 9:15 pm    Post subject: Reply with quote

Yes they were $35.


By the way, the Text to Talk script crashes IF you have a linefeed in your input text
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Nemroth



Joined: 07 Sep 2004
Posts: 262
Location: France

PostPosted: Sat May 28, 2005 5:38 am    Post subject: Reply with quote

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 ?
Back to top
View user's profile Send private message
Spacedog
Guest





PostPosted: Thu Sep 15, 2005 9:59 pm    Post subject: How can you get a script to say something predetermined Reply with quote

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.
Back to top
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Fri Sep 16, 2005 12:24 am    Post subject: Reply with quote

@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
Back to top
View user's profile Send private message
CubeHead
Guest





PostPosted: Tue Nov 29, 2005 5:08 am    Post subject: Very Nice Reply with quote

Nice work, very cool. A nice trick is to add:

Run, (notepad or other program)
Sleep, 3000
^V
Back to top
Guest






PostPosted: Wed Dec 14, 2005 11:01 pm    Post subject: Reply with quote

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
Back to top
quatermass



Joined: 14 Dec 2005
Posts: 121

PostPosted: Wed Dec 14, 2005 11:10 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Grendel



Joined: 18 Nov 2005
Posts: 25
Location: Germany

PostPosted: Sun Dec 25, 2005 9:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
shimanov



Joined: 25 Sep 2005
Posts: 612

PostPosted: Sun Dec 25, 2005 10:53 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
chunwaihome



Joined: 30 Dec 2005
Posts: 3

PostPosted: Fri Dec 30, 2005 2:42 am    Post subject: Reply with quote

Why there is error when i press talk? Sad
I am using 1.0.37 ver
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group