Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: VB6 DirectSS and WMP Mute

  1. #11
    Low Bitrate
    Join Date
    Jun 2007
    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

    spkSpeak.Speak sText

    ---------- 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
    ' etc
    End Enum
    Public Function SayThis(SayWhat As SentenceEnum) As Boolean
     '  ... any code needed to prepare speaking
       Dim sText As String
       Select Case SayWhat
       Case say_IgnitionOff
            sText = "Turning Ignition Off"
       Case say_IgnitionOn
            sText = "Turning Ignition On"
      ' Case say_AccOnAlready
            sText = "Accessories is already On"
       Case say_AccOn
            sText = "Turning Accesories On"
       Case say_Access
            sText = "Authorization is needed to continue"
       '.... other case statements
       End Select
       WM.Settings.volume = 0
      ' spkSpeak.Speaking
       spkSpeak.Speak sText
     'If spkSpeak.Speaking = True Then MsgBox "error i bet"
    Attente (10900)
    WM.Settings.volume = lblVolume.Caption
     '  ... any code needed after speaking
       ' set your return value to true or false
    End Function
    Public Sub Attente(ByVal MilsecToWait As Long)
        Dim lngEndingTime As Long
        lngEndingTime = GetTickCount() + (MilsecToWait)
        Do While GetTickCount() < lngEndingTime
    End Sub
    Last edited by planethax; 02-14-2011 at 03:20 PM.

  2. #12
    Newbie CanuckMark's Avatar
    Join Date
    Feb 2009
    Orillia, Ontario, Canada
    .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:

    Private Sub spkSpeak_SpeakingDone()
    End Sub
    That sub will call when the voice is done speaking...drop your mute command in there and you're done.

    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()
        DirectSS1.Speak "hello hello hello hello hello"
    End Sub
    Private Sub DirectSS1_AudioStop(ByVal hi As Long, ByVal lo As Long)
    End Sub
    Last edited by CanuckMark; 02-15-2011 at 09:03 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Know of a way to mute a car deck with 3.5mm output and no mute out?
    By Mysticle31 in forum General Hardware Discussion
    Replies: 6
    Last Post: 06-09-2009, 11:38 AM
  2. To mute or not to mute... Okay but how ?
    By DeltaFX in forum Software & Software Development
    Replies: 3
    Last Post: 04-28-2009, 01:40 PM
  3. Little help with "BYIND;LINEMUTE;MUTE;Line<<MUTE;Line"
    By antonio_riq in forum Road Runner
    Replies: 6
    Last Post: 01-22-2007, 03:33 PM
  4. Mute Doesn't Mute on M10k?
    By LiquidKernel in forum Car Audio
    Replies: 3
    Last Post: 08-22-2006, 03:12 AM
  5. Mute the Mic?
    By Mattkins99 in forum Road Runner
    Replies: 4
    Last Post: 01-10-2006, 03:30 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts