You hear that? I'm just guessing that ISpVoice structure. Refer to http://msdn.microsoft.com/en-us/library/ms719576(VS.85).aspx
Save as function_SpVoice.inc
;------------------------------------------------------------------------------------
.const
CLSID_SpVoice GUID <096749377h, 03391h, 011D2h, <09Eh, 0E3h, 000h, 0C0h, 04Fh, 079h, 073h, 096h>>
IID_ISpVoice GUID <06C44DF74h, 072B9h, 04992h, <0A1h, 0ECh, 0EFh, 099h, 06Eh, 004h, 022h, 0D4h>>
ISpNotifySource STRUCT
SetNotifySink DWORD ?
SetNotifyWindowMessage DWORD ?
SetNotifyCallbackFunction DWORD ?
SetNotifyCallbackInterface DWORD ?
SetNotifyWin32Event DWORD ?
WaitForNotifyEvent DWORD ?
GetNotifyEventHandle DWORD ?
ISpNotifySource ENDS
ISpEventSource STRUCT
SpNotifySource ISpNotifySource <>
SetInterest DWORD ?
GetEvents DWORD ?
GetInfo DWORD ?
ISpEventSource ENDS
ISpVoiceVtbl STRUCT
; IUnknown methods
QueryInterface DWORD ?
AddRef DWORD ?
Release DWORD ?
; IDispatch methods
;GetTypeInfoCount DWORD ?
;GetTypeInfo DWORD ?
;GetIDsOfNames DWORD ?
;_Invoke DWORD ?
; SpVoice methods
SpEventSource ISpEventSource <>
SetOutput DWORD ?
GetOutputObjectToken DWORD ?
GetOutputStream DWORD ?
_Pause DWORD ?
Resume DWORD ?
SetVoice DWORD ?
GetVoice DWORD ?
Speak DWORD ?
SpeakStream DWORD ?
GetStatus DWORD ?
Skip DWORD ?
SetPriority DWORD ?
GetPriority DWORD ?
SetAlertBoundary DWORD ?
GetAlertBoundary DWORD ?
SetRate DWORD ?
GetRate DWORD ?
SetVolume DWORD ?
GetVolume DWORD ?
WaitUntilDone DWORD ?
SetSyncSpeakTimeout DWORD ?
GetSyncSpeakTimeout DWORD ?
SpeakCompleteEvent DWORD ?
IsUISupported DWORD ?
DisplayUI DWORD ?
ISpVoiceVtbl ENDS
ISpVoice STRUCT
lpVtbl DWORD ?
ISpVoice ENDS
;---------------------------------------------------------------------------
Save as function_SpVoice.inc
;------------------------------------------------------------------------------------
.const
CLSID_SpVoice GUID <096749377h, 03391h, 011D2h, <09Eh, 0E3h, 000h, 0C0h, 04Fh, 079h, 073h, 096h>>
IID_ISpVoice GUID <06C44DF74h, 072B9h, 04992h, <0A1h, 0ECh, 0EFh, 099h, 06Eh, 004h, 022h, 0D4h>>
ISpNotifySource STRUCT
SetNotifySink DWORD ?
SetNotifyWindowMessage DWORD ?
SetNotifyCallbackFunction DWORD ?
SetNotifyCallbackInterface DWORD ?
SetNotifyWin32Event DWORD ?
WaitForNotifyEvent DWORD ?
GetNotifyEventHandle DWORD ?
ISpNotifySource ENDS
ISpEventSource STRUCT
SpNotifySource ISpNotifySource <>
SetInterest DWORD ?
GetEvents DWORD ?
GetInfo DWORD ?
ISpEventSource ENDS
ISpVoiceVtbl STRUCT
; IUnknown methods
QueryInterface DWORD ?
AddRef DWORD ?
Release DWORD ?
; IDispatch methods
;GetTypeInfoCount DWORD ?
;GetTypeInfo DWORD ?
;GetIDsOfNames DWORD ?
;_Invoke DWORD ?
; SpVoice methods
SpEventSource ISpEventSource <>
SetOutput DWORD ?
GetOutputObjectToken DWORD ?
GetOutputStream DWORD ?
_Pause DWORD ?
Resume DWORD ?
SetVoice DWORD ?
GetVoice DWORD ?
Speak DWORD ?
SpeakStream DWORD ?
GetStatus DWORD ?
Skip DWORD ?
SetPriority DWORD ?
GetPriority DWORD ?
SetAlertBoundary DWORD ?
GetAlertBoundary DWORD ?
SetRate DWORD ?
GetRate DWORD ?
SetVolume DWORD ?
GetVolume DWORD ?
WaitUntilDone DWORD ?
SetSyncSpeakTimeout DWORD ?
GetSyncSpeakTimeout DWORD ?
SpeakCompleteEvent DWORD ?
IsUISupported DWORD ?
DisplayUI DWORD ?
ISpVoiceVtbl ENDS
ISpVoice STRUCT
lpVtbl DWORD ?
ISpVoice ENDS
;---------------------------------------------------------------------------
;********************************************
;SpVoice Simple example By G-Spider 2010
;ml /c /coff Speeker.asm
;link /subsystem:console Speeker.obj
;*******************************************
.586
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
include ole32.inc
includelib kernel32.lib
includelib user32.lib
includelib ole32.lib
.data
TEXT dw 'G','o','l','d','e','n',' ','S','p','i' ,'d','e','r',0
.data?
lpSpVoiceCOM dd ?
include function_SpVoice.inc ;<=====The above file
.code
; ---------------------------------------------------------------------------
start:
invoke CoInitialize,0
invoke CoCreateInstance,offset CLSID_SpVoice, 0,CLSCTX_INPROC_SERVER, offset IID_ISpVoice,offset lpSpVoiceCOM
.if eax == 0
push 100 ;USHORT Volume0~100
mov eax,lpSpVoiceCOM
push eax ;<===Note!
mov eax,
call .ISpVoiceVtbl.SetVolume
;-----------------------------------------------------
;lpSpVoiceCOM->Speak(L"Golden Spider", 0, 0)//; c++
;lpSpVoiceCOM->lpVtbl->Speak(lpSpVoiceCOM,L"I LOVE YOU!", 0, 0)//; pure c
push 0
push 0
push offset TEXT
mov eax,lpSpVoiceCOM
push eax
mov eax,.ISpVoice.lpVtbl ;equ mov eax,
call .ISpVoiceVtbl.Speak ;call DWORD PTR
;-------------------------------------------------------
mov eax,lpSpVoiceCOM
push eax
mov eax,
call .ISpVoiceVtbl.SpEventSource.SpNotifySource.SetNotifyWin32Event
;.if eax==0 ;//Test
;invoke MessageBox,0,0,0,0 ;///Success!!!Good Job!!
;.endif
;-------------------------------------------------------
;// release ISpVoice COM interfaces
;lpSpVoiceCOM->lpVtbl->Release(lpSpVoiceCOM)
mov eax,lpSpVoiceCOM
push eax
mov eax,
call .ISpVoiceVtbl.Release
;--------------------------------------------------------
mov lpSpVoiceCOM,0
.endif
;/// CoUninitialize();
invoke CoUninitialize
ret
end start
;SpVoice Simple example By G-Spider 2010
;ml /c /coff Speeker.asm
;link /subsystem:console Speeker.obj
;*******************************************
.586
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
include ole32.inc
includelib kernel32.lib
includelib user32.lib
includelib ole32.lib
.data
TEXT dw 'G','o','l','d','e','n',' ','S','p','i' ,'d','e','r',0
.data?
lpSpVoiceCOM dd ?
include function_SpVoice.inc ;<=====The above file
.code
; ---------------------------------------------------------------------------
start:
invoke CoInitialize,0
invoke CoCreateInstance,offset CLSID_SpVoice, 0,CLSCTX_INPROC_SERVER, offset IID_ISpVoice,offset lpSpVoiceCOM
.if eax == 0
push 100 ;USHORT Volume0~100
mov eax,lpSpVoiceCOM
push eax ;<===Note!
mov eax,
call .ISpVoiceVtbl.SetVolume
;-----------------------------------------------------
;lpSpVoiceCOM->Speak(L"Golden Spider", 0, 0)//; c++
;lpSpVoiceCOM->lpVtbl->Speak(lpSpVoiceCOM,L"I LOVE YOU!", 0, 0)//; pure c
push 0
push 0
push offset TEXT
mov eax,lpSpVoiceCOM
push eax
mov eax,.ISpVoice.lpVtbl ;equ mov eax,
call .ISpVoiceVtbl.Speak ;call DWORD PTR
;-------------------------------------------------------
mov eax,lpSpVoiceCOM
push eax
mov eax,
call .ISpVoiceVtbl.SpEventSource.SpNotifySource.SetNotifyWin32Event
;.if eax==0 ;//Test
;invoke MessageBox,0,0,0,0 ;///Success!!!Good Job!!
;.endif
;-------------------------------------------------------
;// release ISpVoice COM interfaces
;lpSpVoiceCOM->lpVtbl->Release(lpSpVoiceCOM)
mov eax,lpSpVoiceCOM
push eax
mov eax,
call .ISpVoiceVtbl.Release
;--------------------------------------------------------
mov lpSpVoiceCOM,0
.endif
;/// CoUninitialize();
invoke CoUninitialize
ret
end start
Nice job.
Thanks for the code.
The voice is the same as used by some software that old Sound Blasters came with.
Andy
Thanks for the code.
The voice is the same as used by some software that old Sound Blasters came with.
Andy