Results 1 to 19 of 19

Thread: problem with MS Agent

  1. #1

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930

    Unhappy

    I was trying to mess around with some text-to-speech stuff, but I've been having problems getting it to work. I've installed both MS Agent and the standard English TruVoice engine, but I still can only get the MS Agent Control to appear in the VB environment. There is an actual control called TextToSpeech that I need for this to work. Is anyone familiar with using these things in VB that could tell me what I am doing wrong? It almost has to be something I'm doing, but I don't know what.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Question

    I've been doing a lot of work with MS Agent lately, are you talking about an ActiveX Control for Text to Speech. I didn't need one of those. I installed the speech control panel module, then the L&H Speech engines (take your pick of languages). Then I used the Agent.Speak method, and the speech was fine.
    What route did you go down?
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    Frenzied Member mlewis's Avatar
    Join Date
    Sep 2000
    Posts
    1,226
    crispin is right. I do tons of Agent progging and I never needed to use a control. The Speak method's always been fine for me.

    Unless you're doing something different, that should work.
    M. Lewis
    Pi-Q Software
    How many mouse clicks does it take to cook breakfast?

    Blargh! I am dead!

  4. #4

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930

    Unhappy

    I tried messing around with that tutorial on http://www.vb-world.net/misc/agent/ and I couldn't get it to work. When this line runs:
    Code:
    Set CoreAgent = New Agent
    I get a message box that says "Compile error: Invalid use of New keyword". Does anyone know why it's doing that, and what to do to fix it?

    How do you two go about setting up the agent for making it speak?
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  5. #5
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Post

    You need to install msagent.exe from the microsoft site, and then you need to add the reference to "Microsoft Agent Control 2.0" OCX. then put a control on your form and name the agent control (in this case AgtPeedy), then the code below (you might want to change the frmmain references) in principle should work.


    Global Peedy As IAgentCtlCharacter

    Public Sub LoadPeedy()

    'CSW310700 just called once on app load and sets a boolean upon error if
    'CSW310700 we can't load peedy
    On Error GoTo errLoadPeedy

    frmMain.AgtPeedy.Characters.Load "peedy", "peedy.acs"
    Set Peedy = frmMain.AgtPeedy.Characters("peedy")
    Peedy.LanguageID = &H409
    gblnPeedyLostFocus = False
    Peedy.MoveTo 612, 1, 0
    Peedy.Show
    Peedy.Play "Explain"
    Peedy.SoundEffectsOn = True
    Peedy.Commands.Add "PdyOptions", "Advanced Options...", , True, True
    Peedy.Commands.Add "PdyAnimate", "Animate...", , True, True
    Peedy.Speak "Hello World!"
    Peedy.Play "restpose"
    'glngPeedyHandle = FindAgent
    errLoadPeedy:
    Select Case Err.Number
    Case 0
    gblnAssistantLoaded = True
    Case Else
    gblnAssistantLoaded = False
    End Select

    End Sub
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  6. #6

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Ok, I used that method and it seemed to work fine. I did notice that I never got any of the character files. I thought there was just a cheesy basic one already in it, but I guess not. Plus I only have a dialup at home, and didn't want to wait (I'm on the T3 at my grad school now ) Now I've got another question... can I get around needing an agent at all? All I want is just the capability for a program to read text from a textbox, then blurt it out (minus all the cheesy animation of some character on the screen).
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  7. #7
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Yes, that would be v.cool, I think you might need to get into the Text-to-Speech DLL, anbd poke the functions that make this happen, it might be complex. The first hurdle to overcome (assumption here) is that the TTS DLL is C++ and you will have to figure out all the declarations somehow (there is very little documentation on hardcore agent programming out there)
    Once you have done that you will have to work out how to set or fake the appropriate properties that mimick an agent, and just use the TTS with the contents of a textbox.

    NB The above are general assumptions and if the above is a piece o' cake and im on my soapbox would someone kindly push me off

    Thanks

    In the meantime i'm going to give this a go - i'll letcha know...
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  8. #8
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Done It!!!

    Kaverin et al,


    Discard all the other crap above, this what you need to do.

    After installing the speech engines you should be able to add a reference to XVoice.dll in VB.

    Do this and add the following code and it should work.

    Private Sub Command1_Click()
    Dim X As New ACTIVEVOICEPROJECTLib.DirectSS
    X.Speak "Hello World"
    End Sub

    good luck
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  9. #9

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Do you know where that particular dll came from? I must be from the voice control panel thing or one of the characters, because I don't have it anywhere. I didn't get those at first because I didn't think they were absolutely necessary. I didn't have the presence of mind to check on the comp in my office while on the network earlier, but I did use your (crispin's) method to get Merlin working on it. Of course I went all out and got the control panel and all the chars
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  10. #10
    Guest

    Angry You also need one of the service packs

    Have just hit the problem on this PC, and am now waiting for the friggin service pack to finish downloading from msdn. They should mention this in their documentation. ZOn my other PC no problems with SP3.

  11. #11
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  12. #12
    Guest

    Question Not sure what it is crispin, but what the hey

    Ok downloaded for a look

  13. #13
    Guest

    Unhappy Damn still got problems...............

    Have done SP3 and crispin's download. Am still getting an error on 'Agent1.Characters.Load "Merlin", sPath'. Aaaarrrgghhh!!!!!!! out of ideas at this stage. Some thing to do with property incorrect. Any one have any ideas?

  14. #14

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    You do have the merlin.acs file right? If you don't, trying to load it won't work.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  15. #15
    Guest

    Question Yeap have the acs file....interesting development

    Grabbed our version 1.5 of MS Agent from the office and that works fine, but not version 2.0. Am running on a Win 98 SE box and this may be having an effect. No problems with Win 95 or Win 98 or Win NT 4.

  16. #16
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    You've gotta have Agent 2.0 Amigo!!,
    http://activex.microsoft.com/activex...t2/MSagent.exe

    let us know if you get any more probs
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  17. #17
    Guest

    Unhappy Have versions 1.5 & 2.0 installed

    Version 1.5 no problems, version 2.0...what the heck!

  18. #18
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    Mail me Jethro, and I'll mail you back a sample project that works with merlin, and we'll go from there - if you want..
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  19. #19
    Guest

    Angry Thanks crispin, email on the way

    Any one heard when version 3 is being released. It is now well over six months since MS annouced it.

Posting Permissions

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



Click Here to Expand Forum to Full Width