'SAPI - COM SPEECH
DECLARE SUB DLLC_FILE ALIAS "dllfile" LIB "DLLC"
DECLARE SUB DLLC_PROC ALIAS "dllproc" LIB "DLLC"
DECLARE SUB DLLC_GUID ALIAS "dllguid" LIB "DLLC"
DECLARE SUB DLLC_METH ALIAS "dllmeth" LIB "DLLC"
DECLARE SUB DLLC_RECO ALIAS "dllreco" LIB "DLLC"
DECLARE SUB DLLC_WSTR ALIAS "dllwstr" LIB "DLLC"
DECLARE SUB DLLC_CALL ALIAS "dllcall" LIB "DLLC"
DECLARE SUB DLLC_ASTR ALIAS "dllastr" LIB "DLLC"
DECLARE SUB DLLC_COBJ ALIAS "dllcobj" LIB "DLLC"
ole32 = DLLC_FILE("ole32.dll")
CoInitialize = DLLC_PROC(ole32, "CoInitialize (i)")
CoUninitialize = DLLC_PROC(ole32, "CoUninitialize (i)")
CoCreateInstance = DLLC_PROC(ole32, "CoCreateInstance i=(t*ObjGuid ,i pUnkOuter,i context, t*IspGuid, i*Iface)" )
VoiceObjGuid = DLLC_GUID("96749377-3391-11D2-9EE3-00C04F797396")
ISpVoiceGuid = DLLC_GUID("6C44DF74-72B9-4992-A1EC-EF996E0422D4")
Context = 7
pUnkOuter = 0
Voice = 0
Release = DLLC_METH( 2, "Release i=()")
Speak = DLLC_METH(20, "Speak i=(z*pwcs,i flags,i pulstreamno)")
WaitUntilDone= DLLC_METH(32, "WaitUntilDone i=(i)")
PRINT DLLC_RECO(speak)
Text = DLLC_WSTR("Hello World\0")
hr = 0
DLLC_CALL(CoInitialize, 0)
hr = DLLC_CALL(CoCreateInstance, VoiceObjGuid, pUnkouter, Context, ISpVoiceGuid, Voice)
IF (hr = 0) THEN
PRINT "connected to voice\n\n"
PRINT DLLC_ASTR(Text) & "\n\n"
DLLC_COBJ(Voice, Speak, Text, 0, 0)
DLLC_COBJ(Voice, WaitUntilDone, 0xFFFFFFFF)
DLLC_COBJ(Voice, Release)
ELSE
PRINT "SAPI Error " & FORMAT("%x", hr) & "\n\n"
END IF
DLLC_CALL(CoUninitialize)
DLLC_FILE