Jump to content

Text-to-Speech ISpVoice Interface


Danyfirex
 Share

Recommended Posts

Well I was learning about  this great autoit function (ObjCreateInterface) and make this  simple example using ISpVoice.

;Gracias
;http://cyberdays.ru/govoryashhaya-programma


Local Const $CLSID_SpVoice= "{96749377-3391-11D2-9EE3-00C04F797396}"
Local Const $IID_ISpVoice="{6C44DF74-72B9-4992-A1EC-EF996E0422D4}"
Local Const $SPF_DEFAULT = 0

Local Const $sSpVoice = "SetNotifySink hresult(ptr)" & _
           "SetNotifyWindowMessage hresult(hwnd;uint;long;long);" & _
           "SetNotifyCallbackFunction hresult(ptr;long,long);" & _
           "SetNotifyCallbackInterface hresult(ptr;long,long);" & _
           "SetNotifyWin32Event hresult();" & _
           "WaitForNotifyEvent hresult(dword);" & _
           "GetNotifyEventHandle hresult();" & _
           "SetInterest hresult(long;long);" & _
           "GetEvents hresult(ulong;ptr;ptr)" & _
           "GetInfo hresult(ptr);" & _
           "SetOutput hresult(ptr;boolean);" & _
           "GetOutputObjectToken hresult(ptr);" & _
           "GetOutputStream result(ptr);" & _
           "Pause hresult();" & _
           "Resume hresult();" & _
           "SetVoice hresult(ptr);" & _
           "GetVoice hresult(ptr);" & _
           "Speak hresult(wstr;dword;ulong);" & _
           "SpeakStream hresult(ptr;dword;ulong);" & _
           "GetStatus hresult(ptr;ptr);" & _
           "Skip hresult(wstr;long;ulong);" & _
           "SetPriority hresult(long);" & _
           "GetPriority hresult(ptr);" & _
           "SetAlertBoundary hresult(long);" & _
           "GetAlertBoundary hresult(ptr);" & _
           "SetRate hresult(long);" & _
           "GetRate hresult(ptr);" & _
           "SetVolume hresult(ushort);" & _
           "GetVolume hresult(ptr);" & _
           "WaitUntilDone hresult(ulong);" & _
           "SetSyncSpeakTimeout  hresult(ulong);" & _
           "GetSyncSpeakTimeout hresult(ptr);" & _
           "SpeakCompleteEvent hresult();" & _
           "IsUISupported hresult(ptr;ptr;ptr;ptr);" & _
           "DisplayUI hresult(hwnd;ptr;ptr;ptr;ulong);"

Local $oSpVoice = ObjCreateInterface($CLSID_SpVoice, $IID_ISpVoice, $sSpVoice)
$oSpVoice.SetRate(-3)
$oSpVoice.speak("¿Hi Autoit Forum, Are you Okay?",$SPF_DEFAULT,0)
Exit

Saludos

Link to comment
Share on other sites

Yes I know. but the that uses ObjCreate. and this use ObjCreateInterface.

 

Saludos

Link to comment
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
 Share

×
×
  • Create New...