Speech recognition for xlobby and girder ?

Help each other out

Speech recognition for xlobby and girder ?

Postby laumansm on Wed Mar 15, 2006 9:56 am

Has anybody implemented speech input and output using xlobby and girder (just as HAl and homeseer) ?

Marius
laumansm
 
Posts: 5
Joined: Wed Mar 15, 2006 9:52 am

Postby vicom on Wed Mar 15, 2006 11:14 am

I have implemented Speech Output only, using VBcript and Microsoft Agent and Xlobby. I have the Agent read my movie plot before I launch a movie. I've tried the Microsoft Agent Speech Recognition, but its just not worth it
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby hvs69 on Wed Mar 15, 2006 5:21 pm

vicom wrote:I have implemented Speech Output only, using VBcript and Microsoft Agent and Xlobby. I have the Agent read my movie plot before I launch a movie. I've tried the Microsoft Agent Speech Recognition, but its just not worth it


Can you please explain how you did it ? Sounds cool. Thanks
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby vicom on Wed Mar 15, 2006 5:31 pm

Basically i installed: (you can get all these here
-Microsoft Agent
-Agent Characters
-Text-to-Speech Engines (TTS) from Microsoft.


Then I created a VBscript file which I call from within Xlobby (Execute event) and pass it the text I want it to read (as a parameter) . Merlin (or any other character) then popsup and starts reading the text you just passed it.

I'm trying to create a plugin (with more options,if there is any interest) instead of a Vbscript file..but the file works as it is at the moment
Last edited by vicom on Thu Dec 13, 2007 12:00 pm, edited 1 time in total.
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby hvs69 on Thu Mar 16, 2006 12:28 am

Vicom,
Can you please share your vbscript file ?

Thanks a lot.

vicom wrote:Basically i installed: (you can get all these here
-Microsoft Agent
-Agent Characters
-Text-to-Speech Engines (TTS) from Microsoft.


Then I created a VBscript file which I call from within Xlobby (Execute event) and pass it the text I want it to read (as a parameter) . Merlin (or any other character) then popsup and starts reading the text you just passed it.

I'm trying to create a plugin (with more options,if there is any interest) instead of a Vbscript file..but the file works as it is at the moment
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby dalanik on Thu Mar 16, 2006 8:24 am

Yea, pleas do share, it'd be a waste of time if we had to do it all from scratch :-)

Cheers,
D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby rbziggy on Fri Mar 17, 2006 1:00 am

You can also do speech out using the XL xAP plugin and xAP TTS module.

All else thats needed is std microsoft voice engine (it has voices) or you can also buy other voices which are better /higher quality.

I've tried it and it works fine.
rbziggy
 
Posts: 124
Joined: Mon Mar 21, 2005 11:49 pm
Location: UK

Postby dalanik on Fri Mar 17, 2006 1:14 pm

nice program to build animations with MS agent:

http://www.abhisoft.net/mass/

I did it and it's OK with VBS because it doesn't interfere with XLobby, but that way there's less control... it would be cool if we could do it through vb.net - that would allow us to integrate better through XScript plugin...

But the same thing as with skype scripts is preventing me from doing anything - I don't know how to link the components without visual basic/studio. I found the nice tutorial on how to write VB programs with MS agent, but the first step is:

Make sure you have downloaded and installed the MS Agent core components from Microsoft (including the character "Merlin"). Now open up your copy of VB, and follow these instructions:


Right-click on the Toolbox.
Select "Components".
Scroll down the list until you see "Microsoft Agent Control 2.0". Select it and press OK to return to the main window.
Double-click on the "Agent" control in the Toolbox.
You have just put the MS Agent control on a form for the first time!


Now, how would we do this with XScript and w/o VB?? :-)

D.
Last edited by dalanik on Fri Mar 17, 2006 2:07 pm, edited 1 time in total.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby vicom on Fri Mar 17, 2006 1:36 pm

can someone host the vb file for me?

Here is the VB code for the script file I use.

-Copy and save the as Speak.vbs
-To use it : Speak "Welcome to XLobby"
-the argument (text) you pass should be in ""
-this script is currently set to Merlin (character) you can change it to a different character


Code: Select all
' * Agent Object
Dim AgentControl

' * Character Objects
Dim Merlin

' * Variables
Dim UsedChars
Dim MerlinID
Dim MerlinACS
Dim MerlinLoaded
Dim HideReq
Dim Req
Dim ScriptComplete
Dim args,dummy
Set args = Wscript.Arguments

' * Initialize
UsedChars = "Merlin"

' * Merlin
MerlinID = "Merlin"
MerlinACS = "Merlin.acs"
MerlinLoaded = False

ScriptComplete = False

Call Main

'----------------------------------------------------------------------------
Function AgentInstalled()
    ' Purpose:  Returns True if Agent 2.0 is installed, else False
    On Error Resume Next

    If ScriptEngineMajorVersion < 2 Then
        AgentInstalled = False
    Else
        Set AgentControl = WScript.CreateObject("Agent.Control.2", "AgentControl_")
        AgentInstalled = IsObject(AgentControl)
    End If
End Function

'-------------------------------------------------------------------------------
Sub Main()
    On Error Resume Next

    ' * INSERT ANY NON-AGENT RELATED SCRIPTING HERE

    If Not AgentInstalled() Then
        Exit Sub
    End If

    AgentControl.Connected = True

    MerlinLoaded = LoadLocalAgent(MerlinID, MerlinACS)

    If Not MerlinLoaded Then
        MerlinLoaded = LoadLocalAgent(MerlinID, "")
    End If

    If MerlinLoaded Then
        Call SetCharObj
        Call AgentIntro
    Else
        Call LoadError
    End If
End Sub

'---------------------------------------------------------------------------
Function LoadLocalAgent(ByVal CharID, ByVal CharACS)
    ' Purpose:  Attempts to load the specified character
    ' Returns:  True if successful, False if not
    On Error Resume Next

    If CharACS = "" Then
        AgentControl.Characters.Load CharID, CharACS
    Else
        AgentControl.Characters.Load CharID, CharACS
    End If

    If Err = 0 Then
        LoadLocalAgent = True
        Exit Function
    End If
    LoadLocalAgent = False
End Function

'------------------------------------------------------------------------------
Sub SetCharObj()
    ' Purpose:  Sets the character reference and TTS Language ID
    On Error Resume Next

    Set Merlin = AgentControl.Characters(MerlinID)
    Merlin.LanguageID = &H809
End Sub

'-----------------------------------------------------------------------------
Sub AgentControl_RequestComplete(ByVal RequestObject)
    ' Purpose:  Take action on completion or failure of requests
    On Error Resume Next

    If RequestObject <> EndReq Then
    Else
        If Not Merlin.Visible Then
            ' Trigger the Script to Close
            ScriptComplete = True
        Else
            ' It is up to the user to close the script, by right-clicking
            ' the character and selecting 'Exit'
   End If
    End If

    If RequestObject <> HideReq Then
    Else
        AgentControl.Characters.Unload MerlinID
        ScriptComplete = True
    End If
End Sub

'----------------------------------------------------------------------------------------------
Sub LoadError()
    Dim strMsg
    strMsg = "Error Loading Character: " & MerlinID
    strMsg = strMsg & Chr(13) & Chr(13) & "This Microsoft Agent Script requires the character(s):"
    strMsg = strMsg & Chr(13) & UsedChars
    MsgBox strMsg, 48
End Sub

'---------------------------------------------------------------------------------------
Sub AgentControl_Click(ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y)

End Sub

'----------------------------------------------------------------------------------------
Sub AgentControl_DblClick(ByVal CharacterID, ByVal Button, ByVal Shift, ByVal X, ByVal Y)
    ' Purpose:  Stop and Hide all characters on double-click
    On Error Resume Next

    Merlin.StopAll
    If Not MerlinID.HasOtherClients Then
        If Merlin.Visible Then
            Set HideReq = Merlin.Hide()
        Else
            AgentControl.Characters.Unload MerlinID
            ScriptComplete = True
        End If
    End If
End Sub

'--------------------------------------------------------------------------------------------
Sub InitAgentCommands()
    ' Purpose:  Initialize the Commands menu
    Merlin.Commands.RemoveAll
    Merlin.Commands.Caption = "My Menu Name"
    Merlin.Commands.Add "ACO", "Advanced Character Options", "Advanced Character Options"
    Merlin.Commands.Add "Exit", "Exit", "Exit"
End Sub

'-------------------------------------------------------------------------------------------
Sub AgentControl_Command(ByVal UserInput)
    ' Purpose:  Determine Command that was selected either by menu or voice
    '           and run the applicable Command Script
    On Error Resume Next

    Dim BadConfidence
    BadConfidence = 10

    If (UserInput.Confidence <= -40) Then
        ' Bad Recognition
        Exit Sub
    ElseIf (UserInput.Alt1Name <> "") And Abs(Abs(UserInput.Alt1Confidence) - Abs(UserInput.Confidence)) < BadConfidence Then
        ' Bad Confidence - too close to another command
        Exit Sub
    ElseIf (UserInput.Alt2Name <> "") And Abs(Abs(UserInput.Alt2Confidence) - Abs(UserInput.Confidence)) < BadConfidence Then
        ' Bad Confidence - too close to another command
        Exit Sub
    Else ' High Confidence
        ' *** BEGIN USER COMMANDS ***
        Select Case UserInput.Name
        Case "ACO"
            AgentControl.PropertySheet.Visible = True
        End Select
        ' *** END  USER COMMANDS ***

        If UserInput.Name = "Exit" Then
            Set HideReq = Merlin.Hide()
        End If
    End If
End Sub

'--------------------------------------------------------------------------
Sub AgentControl_Bookmark(ByVal BookmarkID)
    On Error Resume Next

End Sub
'-------------------------------------------------------------------------

Sub AgentIntro()
    On Error Resume Next

    Call InitAgentCommands

    ' *** BEGIN  USER SCRIPT ***
    Merlin.Show
    Merlin.TTSModeID = "{C77C5170-2867-11D0-847B-444553540000}"
    Merlin.Balloon.Style = &H264000F

    Merlin.Play "Read"

    Merlin.Speak args(0)
    Merlin.Play "ReadReturn"

    ' Scriptcomplete =true
    ' *** END MASH SCRIPT ***

    Set EndReq = Merlin.Speak("\mrk=999999999\")
     merlin.hide
    Set HideReq = Merlin.Hide()     
    WScript.end
   
Do
        WScript.Sleep 1000
    Loop Until ScriptComplete
End Sub



Shout if you need help
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby hvs69 on Fri Mar 17, 2006 5:29 pm

Thank you. I will try it and let you know.
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby vicom on Mon Mar 20, 2006 6:30 am

Is it working for anyone ?? :roll:
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby S Pittaway on Mon Mar 20, 2006 2:43 pm

i had to change AgentIntro to enable speach output...


Sub AgentIntro()
On Error Resume Next

Call InitAgentCommands

' *** BEGIN USER SCRIPT ***
Merlin.Show
Merlin.Balloon.Style = &H264000F

Merlin.Play "Read"

Merlin.Speak args(0)
Merlin.Play "ReadReturn"

'Scriptcomplete =true
' *** END MASH SCRIPT ***

Set EndReq = Merlin.Speak("\mrk=999999999\")
merlin.hide
Set HideReq = Merlin.Hide()
WScript.end

Do
WScript.Sleep 1000
Loop Until ScriptComplete
End Sub
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby vicom on Mon Mar 20, 2006 2:49 pm

S Pittaway wrote:i had to change AgentIntro to enable speach output...


Yes, some of you will have to remove the following line from AgentIntro

Code: Select all
Merlin.TTSModeID = "{C77C5170-2867-11D0-847B-444553540000}"

This tells MS Agent as to which Text-to-Speech(TTS) to use. The one I used is the American-Voice TTS, hence if you don't use that one you won't have speech output. By removing that line , MS Agent will default to the installed TTS on your machine.

To add a different TTS Mode ID, use the link Dalanik provided above and download and install MASS,
run the program press F8,
choose the voice you like and copy text in the "Mode ID:" box and paste it in the Speak.vbs script on the line that says:
Code: Select all
Merlin.TTSModeID=
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby S Pittaway on Mon Mar 20, 2006 3:12 pm

how do you pass the plot to it?
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Postby vicom on Mon Mar 20, 2006 3:21 pm

S Pittaway wrote:how do you pass the plot to it?


I use the os:execute command
and pass the plot as a parameter
Code: Select all
%movie>plot%


I think.. I'm at the office at the moment I'm not sure with the parameters, I'm think off my head now.
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Next