| View previous topic :: View next topic |
| Author |
Message |
Pasukun
Joined: 16 Dec 2004 Posts: 84
|
Posted: Tue May 24, 2005 7:34 pm Post subject: Text to Talk |
|
|
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 |
_________________
"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 |
|
 |
skrommel
Joined: 30 Jul 2004 Posts: 180
|
Posted: Tue May 24, 2005 10:42 pm Post subject: Cool |
|
|
Cool! Nice workaround!
Skrommel |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 25, 2005 6:22 pm Post subject: |
|
|
Really cool!
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.  |
|
| Back to top |
|
 |
Payam
Joined: 07 Apr 2004 Posts: 58
|
Posted: Thu May 26, 2005 10:38 am Post subject: |
|
|
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 |
|
 |
Invalid User
Joined: 14 Feb 2005 Posts: 442 Location: Texas, Usa
|
Posted: Fri May 27, 2005 7:17 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Payam
Joined: 07 Apr 2004 Posts: 58
|
Posted: Fri May 27, 2005 9:15 pm Post subject: |
|
|
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 |
|
 |
Nemroth
Joined: 07 Sep 2004 Posts: 262 Location: France
|
Posted: Sat May 28, 2005 5:38 am Post subject: |
|
|
| 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 |
|
 |
Spacedog Guest
|
Posted: Thu Sep 15, 2005 9:59 pm Post subject: How can you get a script to say something predetermined |
|
|
| 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
|
Posted: Fri Sep 16, 2005 12:24 am Post subject: |
|
|
@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 |
|
 |
CubeHead Guest
|
Posted: Tue Nov 29, 2005 5:08 am Post subject: Very Nice |
|
|
Nice work, very cool. A nice trick is to add:
Run, (notepad or other program)
Sleep, 3000
^V |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Dec 14, 2005 11:01 pm Post subject: |
|
|
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
|
Posted: Wed Dec 14, 2005 11:10 pm Post subject: |
|
|
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 |
|
 |
Grendel
Joined: 18 Nov 2005 Posts: 25 Location: Germany
|
Posted: Sun Dec 25, 2005 9:41 pm Post subject: |
|
|
| 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 |
|
 |
shimanov
Joined: 25 Sep 2005 Posts: 612
|
Posted: Sun Dec 25, 2005 10:53 pm Post subject: |
|
|
| 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 |
|
 |
chunwaihome
Joined: 30 Dec 2005 Posts: 3
|
Posted: Fri Dec 30, 2005 2:42 am Post subject: |
|
|
Why there is error when i press talk?
I am using 1.0.37 ver |
|
| Back to top |
|
 |
|