Tutorial on Using MSAgent/ 12 February 2016 Tutorial on using Microsoft Agent for PowerPoint 1 Introduction As described in Microsoft’s official website: http://www.microsoft.com/downloads/details.aspx?familyid=E11BF712-7862-45BA826D-44AE3A11836F&displaylang=en, Microsoft Agent is a software technology that enables an enriched form of user interaction that can make using and learning to use a computer, easier and more natural. With the Microsoft Agent set of software services, developers can easily enhance the user interface of their applications and Web pages with interactive personalities in the form of animated characters. These characters can move freely within the computer display, speak aloud (and by displaying text onscreen), and even listen for spoken voice commands. When used effectively with a conversational interface approach, Microsoft Agent can be a powerful extension and enhancement of the existing interactive modalities of the Microsoft Windows® interface (Microsoft, 2007). 2 Ingredients for Running Microsoft Agent You can use MSAgent in several programming environments, VBA, VC++, Java and HTML. We will be exploring all four in this tutorial. But in order to use MSAgent you must have several items on your computer, if you do not have these items don't worry you can download them from the Microsoft's site for free (Crockett, 2001) MSAgent Core Component Text-to-Speech Engine SAPI 4.0 runtime support MSAgent Character: Merlin MSAgent Character: Genie MSAgent Character: Peedy MSAgent Character: Robby You can download these components from: http://www.microsoft.com/downloads/details.aspx?familyid=E11BF712-7862-45BA826D-44AE3A11836F&displaylang=en 3 Working with the MS Agent Template for PowerPoint To make life easier in creating an application of MS Agent for end-users, it is desirable to work from a template. You may download this template prenar.zip from 1 Tutorial on Using MSAgent/ 12 February 2016 http://www.microsoft.com/downloads/details.aspx?FamilyID=b932c4ce-9d60-4824-b e40-e1f48fd63d90&displaylang=en or http://ited.hkbu.edu.hk/ited2002-3/msagent/download/EmptyTemplate.ppt In the template, “EmptyTemplate.ppt”, a computer programme for controlling the MS Agent has already been built in using VBA as the Macro-language. As an end-user, what you need is to key in appropriate commands to control the agent characters to perform in accordance with your instructions. Task 1 4 Exercise: Scripting the Narration (Extract from http://www.microsoft.com/downloads/details.aspx?FamilyID=b932c4ce-9d60-48 24-be40-e1f48fd63d90&displaylang=en) 4.1 Open the template , “EmptyTemplate.ppt” and select the edit mode so that the “Notes Pages” can be displayed: 4.2 The actions of the animated character and the narration that is spoken is all 4.3 derived from the script that is written by the presentation author within the Notes Pages of the document. The Notes Pages can still be used for their intended purpose as speaker notes. The demarcation point between speaker notes and the script for the narrator consists of a specially formatted line of punctuation - ^*#{}#*^. The VBA code of the Presentation Narrator ignores everything prior to this special marker and begins parsing commands to drive the narration following it. 2 Tutorial on Using MSAgent/ 12 February 2016 ^*#{}#*^ SHOW genie, genie.acs, 83, 80 SAY Hello! Thanks for checking out the Presentation Narrator for Microsoft Agent. Please allow me to introduce myself. PLAY Greet PLAY Explain SAY I am Genie, one of the Microsoft Agent characters. PLAY RestPose SLIDE 2=SAY Why don’t we go to the next slide? 4.4 Run the EmptyTemplate.ppt and see how the character performs in accordance with the instructions. 4.5 Download the file grammar.ppt and append it to EmptyTemplate.ppt and save it as grammar-final.ppt Change the background to your desired settings 4.6 4.7 Paste the ‘textbox’ on the first slide of grammar-final.ppt onto the third slide as shown: 4.8 Then remove the text inside the highlighted textbox 4.9 Delete the FIRST TWO slides 4.10 Switch the edit mode to “Notes Pages” and turn to Slide 1 4.11 On the Notes Pages of Slide 1, type in: ^*#{}#*^ SHOW genie, genie.acs, 83, 80 SAY Hello! Please allow me to introduce myself. PLAY Greet PLAY Explain 3 Tutorial on Using MSAgent/ 12 February 2016 SAY I am Genie, one of the Microsoft Agent characters. PLAY RestPose PLAY Explain SAY This is a Grade Five reported speech exercise prepared by Mister Pattle. PLAY Greet PLAY RestPose SAY I hope you will enjoy this exercise. PLAY RestPose PLAY Greet SLIDE 2=SAY Are you ready? 4.12 Save the file and try to run the presentation starting at the first slide 4.13 You may change the wording and use different commands, gestures and animations for the characters as listed in Section 5 4.14 Suggested commands for Slide 2: ^*#{}#*^ MOVE 45, 50 PLAY Explain PLAY Announce SAY Insist:^PAUSE=1500^it means to be firm with somebody and not to take no for an answer. SLIDE 3=SAY ^PAUSE=3000^Let’s move onto the next slide. 4.15 Suggested commands for Slide 3: ^*#{}#*^ MOVE 83, 80 PLAY Explain PLAY Announce SAY “I insist that you stay for dinner”, said Mrs Jones. PLAY Explain PLAY Greet SAY Could you change it into reported speech? PLAY RestPose SAY ^PAUSE=1000^Be careful of the tense. ^PAUSE=10000^ PLAY Wave SLIDE 4=SAY Let’s see what I suggest. 4.16 Suggested commands for Slide 4: ^*#{}#*^ MOVE 5, 5 PLAY Explain 4 Tutorial on Using MSAgent/ 12 February 2016 PLAY Announce SAY “I insist that you stay for dinner”, said Mrs Jones. PLAY Explain PLAY Greet PLAY RestPose SAY Reported Speech: ^PAUSE=1500^Mrs Jones insisted that {eye=I} or we stayed for dinner^PAUSE=10000^. SLIDE 5=SAY Let’s turn to the next slide. 4.17 Suggested commands for Slide 5: ^*#{}#*^ MOVE 80, 5 SAY Wonder and Thought^PAUSE=5000^ PLAY Explain PLAY Announce SAY ^PAUSE=1500^Wonder:^PAUSE=1500^To think if something is true or not^PAUSE=2000^. PLAY Greet PLAY RestPose SAY ^PAUSE=1500^ Thought:^PAUSE=500^past tense of think^PAUSE=2000^. SLIDE 6=SAY ^PAUSE=3000^Let’s move onto the next slide. 4.18 Suggested commands for Slide 6: ^*#{}#*^ MOVE 83, 80 PLAY Explain PLAY Announce SAY ^PAUSE=6000^ THINK “Do you think I have brought enough clothes for the weekend?” asked Ellen. PLAY Explain PLAY Greet PLAY RestPose SAY ^PAUSE=1000^Could you change it into reported speech? SAY ^PAUSE=1000^You may make use of the verb {won-der=wonder}.^PAUSE=10000^ PLAY Wave SLIDE 7=SAY Let’s see what I suggest. 4.19 Suggested commands for Slide 7: ^*#{}#*^ MOVE 50, 50 PLAY Explain 5 Tutorial on Using MSAgent/ 12 February 2016 PLAY Announce SAY Do you think I have brought enough clothes for the weekend? asked Ellen. PLAY Explain PLAY Greet PLAY RestPose SAY Reported Speech: ^PAUSE=1500^ Ellen wondered if she had brought enough clothes for the weekend. ^PAUSE=10000^ PLAY Greet PLAY RestPose SAY Here comes to the end of the exercise. Thank you for your participation and patience. Byebye! PLAY Wave END 5 Reference: Scripting Syntax (Extract from http://www.microsoft.com/downloads/details.aspx?FamilyID=b932c4ce-9d60-48 24-be40-e1f48fd63d90&displaylang=en) The Presentation Narrator supports the following commands and scripting syntax: AUDIO command; AUDIONOCAP command; Comment line; END command; HIDE command; LOOP command; MOVE command; NEXT command; PLAY command; RUN command; SAY command; SAYNOCAP command; SHOW command; SLIDE command; SOUNDFXOFF command; SOUNDFXON command; SUSPEND command; THINK command 5.1 AUDIO command Description Plays the specified audio file and displays the text within the word balloon of the Microsoft Agent character being used as the Presentation Narrator. Syntax AUDIO <filespec> text Example AUDIO <c:\My Documents\Audio\greeting.wav> Hello, I am pleased to meet you. 5.2 Comment line Description 6 Tutorial on Using MSAgent/ 12 February 2016 Comment lines aren’t really commands although they are part of the Presentation Narrator scripting syntax. The Presentation Narrator doesn’t do anything with comment lines except ignore them. Comment lines can be used by script authors to make notes for themselves, provide some formatting to separate lines in the script or a variety of other purposes. Syntax ! text Example ! This is a comment line. 5.3 END command Description This command will hide the Microsoft Agent character being used as the Presentation Narrator and also stop the processing of any scripting commands that follow it on the Notes Page. Syntax END 5.4 HIDE command Description Hides the Microsoft Agent character being used as the Presentation Narrator. Syntax HIDE 5.5 LOOP command Description Causes the Microsoft Agent character being used as the Presentation Narrator to play a looped animation for a specified duration of time. Syntax LOOP time=animation 7 Tutorial on Using MSAgent/ 12 February 2016 Example LOOP 3=Searching 5.6 MOVE command Description Moves the Microsoft Agent character being used as the Presentation Narrator to the specified screen location. Syntax MOVE x, y Example MOVE 50, 50 5.7 PLAY command Description Causes the Microsoft Agent character being used as the Presentation Narrator to play the specified animation. http://msdn2.microsoft.com/en-us/library/ms695821.aspx Syntax PLAY animation Example PLAY Greet 5.8 RUN command Description This command enables you to run an executable program from within your Presentation Narrator script. Syntax RUN pathname Example RUN notepad.exe 8 Tutorial on Using MSAgent/ 12 February 2016 5.9 SAY command Description Causes the Microsoft Agent character being used as the Presentation Narrator to output the specified text as audio and within a word balloon that appears onscreen. Syntax SAY text Example SAY Hello, I am pleased to meet you. Remarks 5.9.1 While long strings of text can be used within a single command, it may be preferable to split these into multiple SAY commands. There may be occasions when the text-to-speech engine being utilized does not properly pronounce a word within the text string. In these cases, you can supply a phonetic substitution in the following form: {phonetic=literal} These phonetic substitutions can be especially useful for handling abbreviations, specific terms, foreign languages, etc. e.g. SAY I am the Presentation Narrator for {em ess=MS} Agent 5.9.2 Also, you can vary the intonation of the speech output with special tags that you include in the Text parameter. The description, syntax and examples of these special tags follow. Use the Emphasis tag immediately preceding a word in order to place emphasis upon its pronunciation. This should take the following format: ^EMPHASIS^word Do not place a space between the Emphasis tag and the target word. e.g. SAY I couldn’t care ^EMPHASIS^less whether you jump. 5.9.3 Use the Monotone tag to change the Text-to-Speech generated output to a monotone voice in character. This should take the following format: 9 Tutorial on Using MSAgent/ 12 February 2016 text ^MONOTONE^ more text 5.9.4 The Monotone tag remains in effect for the remainder of the text of the current command line unless followed by a Normal or Whisper tag. e.g. SAY You are turning into such a ^MONOTONE^ robot worker. 5.9.5 Use the Whisper tag to change the Text-to-Speech generated output to a whispered voice in character. This should take the following format: text ^WHISPER^ more text The Whisper tag remains in effect for the remainder of the text of the current command line unless followed by a Monotone or Normal tag. e.g. SAY To get someone’s attention, ^WHISPER^ just whisper. 5.9.6 Use the Normal tag to reset the Text-to-Speech generated output back to a normal voice. This should take the following format: text ^NORMAL^ more text The Normal tag remains in effect for the remainder of the text of the current command line unless followed by a Monotone or Whisper tag. e.g. SAY Just ^WHISPER^ whisper ^NORMAL^ to get someone’s attention. 5.9.7 Dramatic pauses may be inserted into the text string. These should take the following form: ^PAUSE=time^ where time is a value in milliseconds. e.g. SAY I was just thinking, ^PAUSE=1500^maybe it’s time to pay my bills. 5.9.8 The speaking volume of the speech output can be set with a special tag of the following form: ^VOLUME=number^ where number is the speaking volume with 0 being silence and 65,535 as the maximum. e.g. SAY People listen more intently ^VOLUME=64^ when you speak quietly. 5.9.9 The pitch of the speech output can be set with a special tag of the following form: 10 Tutorial on Using MSAgent/ 12 February 2016 ^PITCH=number^ where number is the pitch in hertz.. e.g. SAY If you inhale helium gas, ^PITCH=500^ your voice will sound like this. ------------------------------------------- 5.9.10 The average talking speed of the speech output can be set with a special tag of the following form: ^SPEED=number^ where number is the average talking speed, in words per minute. e.g. SAY I speak ^SPEED=60^ kind of slow, first thing Sunday mornings... 5.9.11 The volume, pitch, and speed speech output tags stay in effect for the remainder of the SAY command line unless reset with a special tag of the following form: ^RESET^ It is acceptable to use multiple speech output tags in the same SAY command line. e.g. SAY ^SPEED=60^ Sunday mornings are slow ^RESET^ but things pick up later. 5.10 SHOW command Description Loads the designated Microsoft Agent character as the Presentation Narrator and appears at the specified screen location. Syntax SHOW character, character file, x, y 5.11 SLIDE Command Description Advances to the specified slide within the current presentation upon completion of the supplied command. 11 Tutorial on Using MSAgent/ 12 February 2016 Syntax SLIDE slide=command Syntax SLIDE 3=SAY That is enough on this slide, let’s move on. 5.12 SUSPEND command Description Stops execution of the Presentation Narrator scripting in the Notes Page. This suspension lasts indefinitely until you select Resume from the shortcut menu of the character. Syntax SUSPEND Example SUSPEND 5.13 THINK command Description Displays the specified text for the Microsoft Agent character being used as the Presentation Narrator in a “thought” word balloon that appears onscreen. No audio is output with this command. Syntax THINK text Example THINK I really don’t know what to make of the diagram on this slide... 5.14 Scripting Examples The following examples illustrate the scripting utilized by the Presentation Narrator for Microsoft Agent. An example of the scripting added to the Notes Page of a narrated 12 Tutorial on Using MSAgent/ 12 February 2016 presentation. ^*#{}#*^ SHOW merlin, merlin.acs, 98, 75 SAY Hello. Please allow me to introduce myself. PLAY Greet PLAY Explain SAY I am Merlin, one of the Microsoft Agent animated characters. SLIDE 3=SAY I can be used for a multiplicity of purposes. Upon completion of the last command above, the presentation will automatically advance to the third slide and begin processing the following scripting on its NotesPage. ^*#{}#*^ SAY I’m willing to relocate to wherever I’m needed. MOVE 50,50 SAY Did I mention that I’m a determined worker? SAY I will stay with a problem… LOOP 8=Processing SAY Until I have a solution worked out for you. PLAY Congratulate SLIDE 6=SAY But wait! There’s more… Reference Websites Microsoft (2007). Microsoft Agent. Retrieved 2 Oct, 2007, from http://www.microsoft.com/msagent/ Crockett, M. (2001). MSAgent: An Introduction. Retrieved 2 Oct, 2007, from http://home.pacbell.net/cetta/msagent.html 13