Jump to content

Recommended Posts

Posted

Lol, its ok Cyber, advertise EVERYTHING.. BE MY GUEST. hehe..

i543, drop it, its CHAT FORUM.

But it is always better to post in a existing thread than making a new one :rolleyes:

I can do signature me.

Posted (edited)

wow, cool your jets guys, sorry to cause all the cammotion.

Did you know that you can also use tags in the speech?

http://msdn.microsoft.com/library/default....TS_Tutorial.asp

and you can save the speech to a file like this:

;By: SolidSnake
_SpeakToWAV("hello",@ScriptDir&"\TEST.wav")

Func _SpeakToWAV($sText,$sFile)
    $ObjVoice=ObjCreate("Sapi.SpVoice")
    $ObjFile=ObjCreate("SAPI.SpFileStream.1")
    $objFile.Open($sFile,3)
    $objVoice.AudioOutputStream = $objFile
    $objVoice.Speak ($sText)
EndFunc
Edited by CyberZeroCool
Check out ConsultingJoe.com
Posted (edited)

Added functions to Pause and Resume.

#include <Misc.au3>

HotKeySet("^t", "_Talk")
HotKeySet("^e", "_Exit")
HotKeySet("^+{PAUSE}", "_Pause")
HotKeySet("^r", "_Resume")
HotKeySet("^s", "_Stop")

Global $voice = ObjCreate("Sapi.SpVoice")

Local $Talk = 0

While 1
    Sleep(100)
WEnd

Func _Talk()
    $Clip = ClipGet()
    Do
        Speak($Clip, 0, 100)
        $Talk = 1
    Until $Talk = 1 Or _IsPressed(12) & _IsPressed(53)
EndFunc   ;==>_Talk

Func _Stop()
    $voice = ObjCreate("Sapi.SpVoice")
EndFunc 

Func _Pause()
    $voice.Pause
EndFunc

Func _Resume()
    $voice.Resume()
Endfunc

Func Speak($text, $Rate, $Volme)
    Local Const $SVSFlagsAsync = 1
    If IsObj($voice) Then
        $voice.Voice = $voice.GetVoices("Name=Microsoft Sam", "Language=409").Item(0)
        $voice.Rate = $Rate
        $voice.Volume = $Volme
        $voice.Speak ($text, $SVSFlagsAsync)        
    EndIf
EndFunc   ;==>Speak

Func _Exit()
    Exit
EndFunc   ;==>_Exit
Edited by zfisherdrums
Posted

Cool, thanks zfisherdrums :rolleyes:

Hey, I know I mentioned that my script was meant as more of a joke/commentary on the marketing of useless software - but could I use part of your script in my re-write of LazyReader? I would of course credit you, CyberZeroCool, i542, SolidSnake, et al.

Posted (edited)

By the way, do any of you know how you can find the different voices currently installed on the system?

Look at my very first (or it was second :rolleyes: ) topic here and gafrosts answer here.

It uses

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error handler

_TalkOBJ('This is auto it beta speaking.', 1)
_TalkOBJ('This is auto it beta speaking.', 2)
_TalkOBJ('This is auto it beta speaking.', 3)

;voice params:
;
;1 - Microsoft Mary
;1 - Microsoft Sam
;3 - Microsoft Mike

Func _TalkOBJ($s_text, $s_voice = 3)
    Local $o_speech = ObjCreate ("SAPI.SpVoice")
        Select
            Case $s_voice == 1
                $o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Mary", "Language=409").Item(0)
            Case $s_voice == 2
                $o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Mike", "Language=409").Item(0)
            Case $s_voice == 3
                $o_speech.Voice = $o_speech.GetVoices("Name=Microsoft Sam", "Language=409").Item(0)
        EndSelect
    $o_speech.Speak ($s_text)
    $o_speech = ""
EndFunc  ;==>_TalkOBJ

; This is my custom error handler
Func MyErrFunc()
   $HexNumber=hex($oMyError.number,8)
   Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
               "Number is: " & $HexNumber & @CRLF & _
               "Windescription is: " & $oMyError.windescription )

   SetError(1); something to check for when this function returns
Endfunc

Hey, I know I mentioned that my script was meant as more of a joke/commentary on the marketing of useless software - but could I use part of your script in my re-write of LazyReader? I would of course credit you, CyberZeroCool, i542, SolidSnake, et al.

no problems at all :rambo: Edited by i542

I can do signature me.

Posted

No, I mean is there away to determine what voices have been installed. That just lets you pick a voice.

AFAIK, no :rolleyes:

I can do signature me.

Posted

What happends if you copy an image?

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

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
  • Recently Browsing   0 members

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