Jump to content
Sign in to follow this  
spyrorocks

Accessing Ms Speech

Recommended Posts

spyrorocks

Hello. Im just wonderin how you would go about accessing the speech agent in windows with autoit. Oh, ya, if it makes a diffrence, im not using the beta. Im using the one below the beta.

Share this post


Link to post
Share on other sites
Simucal

Hello. Im just wonderin how you would go about accessing the speech agent in windows with autoit. Oh, ya, if it makes a diffrence, im not using the beta. Im using the one below the beta.

~ U S E ~ the search function of the forum. I did a search for "speech" title only, all forums and easily found the answer.

And Yes, it matters.. you need beta for ObjCreate.

;Speak("text to speak", 1-10 rate of speaking,
;0 - 100 Colume
$input=InputBox("Text to Speak", "Type Text")
Dim $voice = ObjCreate("Sapi.SpVoice")
Func Speak($Text, $Rate, $Vol)
$voice.Rate = $Rate
$voice.Volume = $Vol
$voice.Speak($Text)
EndFunc
Speak($input, 1, 100)
Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites
Lakes

~ U S E ~ the search function of the forum. I did a search for "speech" title only, all forums and easily found the answer.

If you want to use The MS Agent Characters:

#include<guiconstants.au3>

GuiCreate("MSAgent Viewer", 280, 100)
GuiCtrlCreateLabel("Select Character", 15, 10, 125, 20)
GuiCtrlCreateLabel("Select Animation", 150, 10, 125, 20)
$combo_name = GuiCtrlCreateCombo("", 10, 35, 125, 20)
GuiCtrlSetData($combo_name, "Merlin|Genie|Peedy|Robbie")
$combo_1 = GuiCtrlCreateCombo("", 145, 35, 125, 20)
$btn_submit = GuiCtrlCreateButton("Submit", 80, 65, 125, 20)
GuiSetState()
While 1
    $msg = GUIGetMsg()

    Select
    Case $msg = $combo_name
        $oAgentName = GuiCtrlRead($combo_name)
        If $oAgentName <> "Merlin" Then
            $oAgentPath = @ProgramFilesDir & "\Microsoft Office\Office11\" & _
            $oAgentName & ".acs"
        Else
            $oAgentPath = @WindowsDir & "\Msagent\Chars\" & $oAgentName & ".acs"
        EndIf

        $oAgent = ObjCreate("Agent.Control.2")
        $oAgent.Connected = "True"
        $oAgent.Characters.Load($oAgentName, $oAgentPath)
        $oChar = $oAgent.Characters($oAgentName)

        For $name in $oChar.AnimationNames
        GuiCtrlSetData($combo_1, $name & "|") ;get Animations for selected Character
        Next

    Case $msg = $btn_submit
        $anim = GuiCtrlRead($combo_1)
        $oChar.Show
    $oChar.speak('\Chr="Whisper"\Hello\Chr="Normal"\ \pau=2000\I am ' & $oAgentName)
    $oChar.MoveTo(250,250)
    $oChar.Play("Wave")
        $oStatus = $oChar.Play($anim)
        While $oStatus.Status > 0
            Sleep(100)
        WEnd
        $oChar.Hide
    EndSelect
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

This is from the Forum, but I could`nt find the original posting..


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×