Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: VB6 DirectSS and WMP Mute

  1. #1
    Low Bitrate
    Join Date
    Jun 2007
    Posts
    76

    VB6 DirectSS and WMP Mute

    I think I am in correct forum lol.

    Looking for some info for my personal CarPuter

    Written in VB6 and Using DirectSS for Voice

    .Speak " Speaking this text"


    How would I go about having Windows Media Player Mute during Speak ?

  2. #2
    Low Bitrate
    Join Date
    Jun 2007
    Posts
    76
    Any of you Front end coders have any suggestions?

    I am thinking I need to make a function with the
    spSpeak.speak
    and
    WMP.Settings.Mute = true

    Code:
    Private Function funSpeak()
    dim speak as ?
    WMP.Settings.Mute = true
    spSpeak.Speak
    WMP.Settings.Mute = False
    End Function
    Then everywhere in my code I have spSpeak.Speak "speak this"
    I would just call the function

    Speak() "Speak This? "


    You think I am on correct track here?

  3. #3
    Low Bitrate
    Join Date
    Jun 2007
    Posts
    76
    Since the .Speak text is always different, I am not sure how to make a function for it?

    speak = spSpeak.Speak + the text that needed?

    Hmmm
    So I guess I could use an ini file with all the specific sentences in it,
    But still not sure how to do this one line??

    spSpeak.Speak <- What after here?

  4. #4
    Newbie CanuckMark's Avatar
    Join Date
    Feb 2009
    Location
    Orillia, Ontario, Canada
    Posts
    33
    I am using VB6 for my front end as well and plan to use voice recognition with speech (SAPI 4). The problem I had was when I sent a .speak, the VR heard it too and got "confused".

    The challenge is when a .speak is sent the program doesn't wait for the speech to finish, it keeps going. So in the piece of code you posted the WMP would unmute before the voise was done speaking.

    I have to get back to it, but I believe the solution is to set up a TTS event (speakingdone) that will unmute the WMP when it is done speaking. So you would set up a speakingdone event where the WMP unmutes; then when you send a speak command you would mute the WMP audio, send the .speak, and when the speak is done it will call the event and unmute the WMP.

    Have you tried any of the non-Microsoft voices? The AT&T "Natural" ones are quite a bit better than what MS supplies. Also which SAPI version are you using, 5 or 4? I've found 4 to be better to work with.
    Last edited by CanuckMark; 02-08-2011 at 01:38 PM.

  5. #5
    Low Bitrate
    Join Date
    Jun 2007
    Posts
    76
    I am using 4 as well,
    I was thinking to use a pause in the function but ur Idea sounds much better.

    I am also wanting to control unwanted activation as well.
    Right now I just have a special command word and long sentences, but am wondering if 2 instances of the voice recognition might work.


    Eg;
    One instant of voice recognition, with only ONE word, which in turn would enable the second to start listening?

    But that may slow app down way too much?

  6. #6
    Newbie CanuckMark's Avatar
    Join Date
    Feb 2009
    Location
    Orillia, Ontario, Canada
    Posts
    33
    To solve that problem I was planning to mute the microphone whenever TTS was speaking (then have it unmute the mic when TTS is done). Basically like what you're trying to do with the WMP (same process of events anyway). That way the VR simply can't hear the speak. My gues is that would be easier than an extra instance of VR.

  7. #7
    Low Bitrate
    Join Date
    Jun 2007
    Posts
    76
    True, but I am thinking about regular conversation and music in the back ground.

    As for it here speak, I was making the Speak have different terms than the VR menu
    example, If I say "goto Naviagtion" then I make sure the Speak doesnt ever say Navigation, I may have it say Nav Panel etc etc.

    Muting the Mic would be good though!

  8. #8
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    I don't know about the VB6 API, but in VB.NET, waiting for variable-length speech to finish is pretty easy. I have to do it in my FrontEnd.

    My solution: When speech is started, mute WMP and create a timer to poll the SpeechState until speech has stopped. When it has stopped, restore volume and kill the timer.

    The code in the timer tick event is something like this in my front end:
    If SpechObj.State <> System.Speech.Synthesis.SynthesizerState.Speaking Then
    Timer.Stop
    RestoreVolume
    End If

    Again, like I said, I don't know the VB6 Speech API. I had to abandon VB6 a while ago. But it's probably something similar, but with more API involved.

  9. #9
    Newbie CanuckMark's Avatar
    Join Date
    Feb 2009
    Location
    Orillia, Ontario, Canada
    Posts
    33
    Yup, that's another approach. Originally I was looking at that variable, but then I found the .speakingdone event and was sold. It made things work a lot more efficiently.

  10. #10
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    701
    Quote Originally Posted by CanuckMark View Post
    Yup, that's another approach. Originally I was looking at that variable, but then I found the .speakingdone event and was sold. It made things work a lot more efficiently.
    Somehow I never even noticed that event existed. Nice!

    So yeah, use the event if it's exposed in VB6. Not a timer.

Page 1 of 2 12 LastLast

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, 10: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, 12: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, 02:33 PM
  4. Mute Doesn't Mute on M10k?
    By LiquidKernel in forum Car Audio
    Replies: 3
    Last Post: 08-22-2006, 02:12 AM
  5. Mute the Mic?
    By Mattkins99 in forum Road Runner
    Replies: 4
    Last Post: 01-10-2006, 02:30 PM

Bookmarks

Posting Permissions

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