Jump to content

_Talk, this function speaks text to u! :D


El-Trucha
 Share

Recommended Posts

Here's my script:

#cs
Name: _Talk 1.0
Author: El-Trucha <eltrucha14@gmail.com>
Date|Time: 2/25/05 | 10:44 PM
Dev Tool: AutoIt v3.1.0
Requirements: WSH 5.6 ENABLED!!
Description: This function speaks whatever 
    string you specify in $sText
#ce

Func _Talk($sText)
    $tempFile = @TempDir & '\talktemp.vbs'  ; Set the temp file
    FileWriteLine($tempFile, 'Dim Talk' & @CRLF & _
    'Set Talk = WScript.CreateObject("SAPI.SpVoice")' & _
    @CRLF & 'Talk.Speak "' & $sText & '"'); Add contents to the temp file
    RunWait('Wscript.exe talktemp.vbs', @TempDir); Run the VBScript
    FileDelete($tempFile)
EndFunc

I made a program that uses this script...I'll upload it 2 www.truchasoft.tk soon!! :lmao:

Hope u like it!! o:)

El-Truchahttp://www.truchasoft.tk[url="ftp://tsfc.homeftp.net"]ftp://tsfc.homeftp.net[/url]hotline://tsfc.ath.cx

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

:) :) :)

Extremly funny :whistle:

Small but great....thanks :lmao:

Could maybe used for informing/warning messages like a countdown o:)

edit: here is what I mean:

#cs
Name: _Talk 1.0
Author: El-Trucha <eltrucha14@gmail.com>
Date|Time: 2/25/05 | 10:44 PM
Dev Tool: AutoIt v3.1.0
Requirements: WSH 5.6 ENABLED!!
Description: This function speaks whatever
    string you specify in $sText
#ce
For $i = 10 To 0 Step -1
    _Talk($i)
    Sleep(750)
Next

_Talk("Start the engines")

Exit

Func _Talk($sText)
    $tempFile = @TempDir & '\talktemp.vbs'   ; Set the temp file
    FileWriteLine($tempFile, 'Dim Talk' & @CRLF & _
    'Set Talk = WScript.CreateObject("SAPI.SpVoice")' & _
    @CRLF & 'Talk.Speak "' & $sText & '"'); Add contents to the temp file
    RunWait('Wscript.exe talktemp.vbs', @TempDir); Run the VBScript
    FileDelete($tempFile)
EndFunc

Thanks a lot EL :huh2:

Edited by Holger
Link to comment
Share on other sites

HAH!

Excellent, this is amazing. Thanks a ton. :lmao:

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Here's my script:

#cs
Name: _Talk 1.0
Author: El-Trucha <eltrucha14@gmail.com>
Date|Time: 2/25/05 | 10:44 PM
Dev Tool: AutoIt v3.1.0
Requirements: WSH 5.6 ENABLED!!
Description: This function speaks whatever 
    string you specify in $sText
#ce

Func _Talk($sText)
    $tempFile = @TempDir & '\talktemp.vbs'    ; Set the temp file
    FileWriteLine($tempFile, 'Dim Talk' & @CRLF & _
    'Set Talk = WScript.CreateObject("SAPI.SpVoice")' & _
    @CRLF & 'Talk.Speak "' & $sText & '"'); Add contents to the temp file
    RunWait('Wscript.exe talktemp.vbs', @TempDir); Run the VBScript
    FileDelete($tempFile)
EndFunc

I made a program that uses this script...I'll upload it 2 www.truchasoft.tk soon!! :)

Hope u like it!! :)

<{POST_SNAPBACK}>

huhu El-Trucha o:) funny great job and your SimpleDragonFightin 1.1 is cool :lmao:

Thx dudu :)

Link to comment
Share on other sites

I found some code on the internet that will allow you to change to whatever voice you want. I have the AT&T Natural voices installed, so I will include the code to call for the female voice, crystal16, if you have it. To change the voice, just uncomment the line for the voice you want. If a voice is not installed, you will receive an error. Here goes... :lmao:

' Declaring variable to hold SAPI object.
Dim voic 

' Creating SAPI object using spvoice.
Set voic = Wscript.CreateObject("SAPI.SpVoice")

' If you want to change the voice then uncomment any of the following 4 lines.

'Set voic.voice = voic.GetVoices("Name=Microsoft mary", "Language=409").Item(0)
'Set voic.voice = voic.GetVoices("Name=Microsoft mike", "Language=409").Item(0)
'Set voic.voice = voic.GetVoices("Name=Microsoft sam", "Language=409").Item(0)
'Set voic.voice = voic.GetVoices("Name=crystal16", "Language=409").Item(0)

' you can set other parameters and properties like voice pitch, speed etc.   

' Using speak function of SpVoice to speak a string.
voic.Speak("Welcome To My First Speech Enabled ASP Page, Have a nice day!")

' Destroying SAPI.spvoice object.
Set voic = nothing
Edited by Roger
Link to comment
Share on other sites

I will put this in our inventory tracking system so the guys in the warehouse don't have to look at the computer screen to verify that they put something in right. I will need a volume control because maybe it will get annoying! Hope it works in W2000...

J

If I am too verbose, just say so. You don't need to run on and on.

Link to comment
Share on other sites

real nice el-trucha :) i like it a lot lol reminds me of ventrilo lol o:)

it's the same voice

<{POST_SNAPBACK}>

I'm not sure what I am missing here, but I have tried running this script and I get the following errors: :lmao:

Title: Windows Cript Host

Error: Name Redefined.

Code: 800A0411

Source: VBScript compilation error.

The next error is:

Could not laocate automation class named "SAPI.SpVoice"

Source: WScript.CreateObject.

Can someone give me an idea of what I may be missing.

Thanks

Link to comment
Share on other sites

Hi Sir_Bob:

Which OS are you running?

When you go to Control Panel do you have a Speech item?

There is a Microsoft dl, which I understand is required for speech recognition, but I do not know if that applies here or not.

J

If I am too verbose, just say so. You don't need to run on and on.

Link to comment
Share on other sites

The script only runs on Windows XP. In order for you to run it on Windows 2000 or below, you have to download SDK 5.1 from microsoft and make sure you have the microsoft voices installed and text to speach engine installed.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...