Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Include "sapi.inc"
%Msg_SAPI_Event = %WM_User + 1
Function PBMain() As Long
Local hr As Long, hDlg As Dword, wText As WString, pSp As ISpVoice
pSp = NewCom "SAPI.SpVoice"
wText = "Microsoft Zira Desktop - English (United States)"
hr = SpSetVoice(pSp,wText)
wText = "My name is Microsoft Zira"
pSp.Speak(ByVal StrPtr(wText), %SPF_Async, ByVal %Null)
Sleep 3000
wText = "Microsoft David Desktop - English (United States)"
hr = SpSetVoice(pSp,wText)
wText = "My name is Microsoft David"
pSp.Speak(ByVal StrPtr(wText), %SPF_Async, ByVal %Null)
Sleep 3000
End Function
http://www.garybeene.com/sw/gbsnippets.htm