Post by ObiWanPost by ObiWanStart by enclosing the SAPI "glue code" inside a class module exposing
the desired properties and method and encapsulating all the SAPI call
Just to be more clear, your SAPI class module may wrap code to
enumerate the various available voices and languages and to select the
various parameters like pitch, speed and so on
Like I said only very rudimentary at this time. The one problem is even
at 100% volume the voice is not very loud. I know that there are
soneother voices that I can download and try, but I have had some other
things to work on and so this got moved to the back burner for now.
Private Sub Form_Load() 'Start Up code
Me.Left = (Screen.Width - Me.Width) / 2 'Center form on screen
Me.Top = (Screen.Height - Me.Height) / 2
'
sMsg = "Hello World, this is S.A.P.I. that is, Speech API"
Set objSAPI = CreateObject("SAPI.SPVoice")
'
' My Windows 7 Computer only has 1 Voice
'
Debug.Print "Voice Count = "; objSAPI.GetVoices.Count
Set objSAPI.Voice = objSAPI.GetVoices.Item(0)
'
' The default rate for a voice is set through Speech properties in
Control Panel.
' Values for the Rate property range from -10 to 10, which represent the
slowest
' and the fastest speaking rates, respectively.
'
objSAPI.Rate = -5
objSAPI.Volume = 100
End Sub
Stan
--
This email has been checked for viruses by Avast antivirus software.
www.avast.com