Merlin.Speak "You do not have the Lernout & Houspie TrueVoice engine installed! Please download and install it from http://msdn.microsoft.com/workshop/imedia/agent/default.asp"
End If
Case "Internet"
If Agent.AudioOutput.Enabled Then
Merlin.Speak ".", "KingOfTheHill.wav"
'They can also speak wav files, the
'[TEXT] and [URL] can be omitted
'(left out), so you can have just text,
'just a sound file, or both
'(or neither, though that would be useless!)
'An hour ago this worked fine without the ".",
'though it wont now... try removing it :)
Else
Merlin.Speak "You do not have the Lernout & Houspie TrueVoice engine installed! Please download and install it from http://msdn.microsoft.com/workshop/imedia/agent/default.asp"
End If
Case "OffChar"
Merlin.Speak "Yes, \pau=200\you can use Office Assistant ACS character files, though they do not have the same animations as proper characters do, and they often cannot speak, only mime.. \pau=700\So I guess you will never hear Clippit's voice.."
'\pau=200\ is a 'speech modifier'
'see at the end for a definition
Case "Goodbye"
'If UserInput.Confidence < 0 Then
' Merlin.Speak "Are you sure you want to say goodbye?"
Genie.Play "RestPose" 'Return Genie to default position
Genie.Speak "I hope Geeza's code will help you to create Agent scripts easily too, \pau=100\and get around the problem that we can't pronounce Geeza correctly. \pau=200\G-eeza, \pau=200\GG eeza... \pau=70\"
Genie.Play "Explain"
Genie.Speak "\emp\Oh well..\pau=100\"
Genie.Play "RestPose"
Genie.Speak "Microsoft Agent is a very powerful tool, \pau=100\If you can find a use for it\pau=300\"
Genie.Speak "\pau=100\Agents can give help, \pau=100\play animations, \pau=100\speak text (for example, \pau=50\you can use us to read your e-mail), \pau=100\give presentations, \pau=100\and lots more\pau=100\"
Genie.Speak "We can even have multiple characters, \pau=100\interacting with you and each other\pau=500\"
Set Request = Genie.Speak("And to help me explain these features, \pau=100\here's Merlin!\pau=100\")
'Sets the Request to this, so another Character can
'be set to wait for this instruction to complete
'before comtinuing their que of commands
Genie.Play "LookLeft"
Merlin.MoveTo 320, 240
Merlin.Wait Request 'Wait for genie to finish speaking
Merlin.Show 'then Show Merlin
Merlin.Play "Wave"
Merlin.Speak "Hello everyone!"
Merlin.Play "RestPose"
Merlin.Speak "I am Merlin; \pau=150\another Microsoft Agent Character\pau=100\"
Set Request = Merlin.Speak("Though there are even more characters than us, \pau=100\such as Robby the robot,")
Merlin.Play "RestPose"
Genie.Wait Request 'Same as before
Genie.Play "LookLeftReturn"
Set Request = Genie.Speak("Peedy the Parrot,\pau=100\")
Genie.Play "LookLeft"
Merlin.Wait Request
Merlin.Play "Explain"
Set Request = Merlin.Speak("and all the Microsoft Office 2000 help Assistants!\pau=100\")
Merlin.Play "Blink"
Genie.Wait Request
Genie.Play "LookLeftReturn"
Set Request = Genie.Speak("Yes, \pau=200\all the Office 2000 Assistants are MS Agents, \pau=100\though this is not what Agent was originally written for..")
Genie.Play "LookLeft"
Merlin.Wait Request
Set Request = Merlin.Speak("We were originally created for use on the Internet, \pau=100\through web pages, \pau=100\and have many other features. We can speak, \pau=100\as we are now, \pau=140\speak Wav sound files, \pau=140\speak Linguistically Enhanced Wave sound files, \pau=140\gesture, \pau=140\move, \pau=140\register when the user clicks or drags us, \pau=140\and even accept speech input!")
Merlin.Play "LookRight"
'Request is a MUST if you intend to use multiple
'characters, you may even need seperate request
'variables for each character, such as MerlinRequest
'don't believe me? Remove 'Set Request = ' from
'everywhere you see it, then run this
Genie.Wait Request
Genie.Play "LookLeftReturn"
Set Request = Genie.Speak("Well, \pau=100\that's enough explaining our features, \pau=100\I'm off to the pub with Clippit, \pau=200\why not let Merlin show you some of our features?")
Merlin.Wait Request
Merlin.Play "LookRightReturn"
Merlin.Speak "Later Genie! \pau=260\Don't get too drunk"
Genie.Play "Wave"
Set LoadRequest(2) = Genie.Hide 'After he's hidden, unload him
Call MerlinSolo 'It's a good idea to separate these
'routines, to avoid comfusion and make
'debugging easier
End Sub
Private Sub MerlinSolo()
Merlin.Wait LoadRequest(2) 'wait until Genie is hidden
'and unloaded (you can set
'this to other things than
'Request, you see)
Merlin.Speak "Well, now Genie has gone, \pau=130\why not try voice commands.\pau=1000\"
Merlin.Speak "All visible voice commands for an agent are listed in the Agent Commands Window"
Merlin.Play "Restpose"
Merlin.Speak "Just Right-Click my Magic hat icon in your system tray, \pau=130\ or right click me, \pau=130\to make my menu appear,\pau=500\"
Merlin.Speak "Then either click 'Open Voice Commands Window' to display the commands window, or if you like you can click one of my voice commands directly from the menu to run it, say if you haven't got a microphone or do not have the Speech Input addon installed.\pau=1000\"
Merlin.Speak "But, \pau=170\if you do have a microphone, hold down the Scroll-Lock key, wait for the tooltip to say I'm ready to listen, then say the command you wish me to execute\pau=750\"
Merlin.Speak "The power is now in your hands!\pau=800\"
Merlin.Speak "By the way, I like Cheesy Poofs..."
Merlin.Play "Acknowledge"
IntroComplete = True
End Sub
Private Sub Form_Load()
Call LoadGenie
Call LoadMerlin 'Load the characters
'This is handled differently if the show is
'continuous, see the other form
End Sub
Private Sub Form_Unload(Cancel As Integer)
'This doesn't work yet, and i'm too tired to make it work
'it'll be good programming practice for you anyhow :)
On Error Resume Next 'needed incase one has already been
'unloaded
Set LoadRequest(2) = Genie.Hide 'Hide and unload the
Set LoadRequest(3) = Merlin.Hide 'characters
End Sub
'OK, you should be able to see how this works :) And if
'not, you'll still be able to use it.
'Just a few more things:
'The Speech Modifiers:
' 1. \emp\ Emphasise the next word
' 2. \pau = m\ Pause for m milliseconds
' 3. \pit = p\ Pitch voice to p Hertz (1 - 400)
' 4. \spd = s\ Set speed to s Words per minute
' (50-250) -Thanks Ric for that one
'These are the only three I've ever seen and know
'If you need the components for Agent, whatever they may be
'DO NOT ask me for them, i wont send them, they're way too
'big! Get them on the microsof Agent site
'it should be at http://msdn.microsoft.com/workshop/imedia/agent/default.asp
'There is no way of listing all the animations of an Agent
'(other than going through every possible combination or
'decompiling them) so to find them out you'll need
'AllDocs.zip from the microsoft Agent site for the Merlin
'etc. animations
'If you are offended by or if i've done something wrong by
'putting in the example sound files, i am very sorry, and
'if you want i'll remove the files, though they are just
'for a laugh, and hey it's good advertising right? :)
'Well that's just about Everything to do with Agent! lol
'i hope this helps!
'If it did, could you just add a reference to me in your
'"About" box or whatever just to say that i did :) thanks
'OK , I'm off to sleep!!
'Check out my other project on-line so far-
' Floating Objects on Invisibe Forms
' And, Killer Button!
'Goodnight All!
'GEEZA
'*Of all the things I've lost, I miss my mind the most*