I am not seeing this in vb6
' If spkSpeak.speakingdone = False Then MsgBox "error"
I do see thiese but they do not seem to do anything
---------- Post added at 03:50 PM ---------- Previous post was at 03:15 PM ----------
Here is my temp solution, I leave some commented lines there so you can see some of what I have tried.
Public Enum SentenceEnum
Public Function SayThis(SayWhat As SentenceEnum) As Boolean
' ... any code needed to prepare speaking
Dim sText As String
Select Case SayWhat
sText = "Turning Ignition Off"
sText = "Turning Ignition On"
' Case say_AccOnAlready
sText = "Accessories is already On"
sText = "Turning Accesories On"
sText = "Authorization is needed to continue"
'.... other case statements
WM.Settings.volume = 0
'If spkSpeak.Speaking = True Then MsgBox "error i bet"
WM.Settings.volume = lblVolume.Caption
' ... any code needed after speaking
' set your return value to true or false
Public Sub Attente(ByVal MilsecToWait As Long)
Dim lngEndingTime As Long
lngEndingTime = GetTickCount() + (MilsecToWait)
Do While GetTickCount() < lngEndingTime
.speakingdone is not a property, it is an event. Under the code window, select the TTS control in the top-left dropdown (in your case it is called spkSpeak, the "Text To Speech" control). Then look at the list in the right dropdown; you'll find a whole bunch of events that are automatically called when different things happen. SpeakingDone and SpeakingStarted are the two obvious useable ones.
When you select SpeakingDone from that list, you'll get this:
That sub will call when the voice is done speaking...drop your mute command in there and you're done. :)
Private Sub spkSpeak_SpeakingDone()
EDIT: I took another look at this and it appears we were working with two different versions of the text-to-speech OCX - my SAPI4 installed two different OCXs. I was looking at the events of the TextToSpeech one and you seem to be using the DirectSS one. The good news is it still works, but the event is called AudioStop instead of SpeakingDone. Same thing, it's an event - set up the sub in the code. I just tried it - I sent some speak to it and the instant it finished speaking it called the AudioStop event.
Something like this:
Private Sub Command1_Click()
' MUTE THE WMP HERE
DirectSS1.Speak "hello hello hello hello hello"
Private Sub DirectSS1_AudioStop(ByVal hi As Long, ByVal lo As Long)
' UNMUTE THE WMP HERE