synthesizer is speaking. This allows for motions such as moving the robot’s mouth, while it is speaking. Both the ‘Delay’ and ‘Speech’ attributes can be used with Frames that contain no ServoPositions, to allow for delay or speech behavior without servo motion. Here is a modified version of the first example, with some extra ‘Delay’ and ‘Speech’ Frames: <Sequence Name="Example Sequence 2"> <Frame TimeToDestination="1"> <ServoPosition Index="0" Position="800" /> <ServoPosition Index="1" Position="1200" /> </Frame> <Frame Delay="2"/> <Frame Speech="Testing one two three."/> <Frame TimeToDestination="0.5"> <ServoPosition Index="0" Position="2200" /> <ServoPosition Index="1" Position="1000" /> </Frame> </Sequence> This example Sequence contains four frames, but the first and fourth frames are identical to be previous example. When running this Sequence, the first Frame will be processed as before, with Servos 0 and 1 moving to their respective positions. Once this movement completes, the second Frame will be processed and the Delay=“2” attribute will cause the Sequence to pause for 2 seconds. After these 2 seconds, the third Frame will be processed, and the ‘Speech’ attribute will cause the speech synthesizer to start speaking the selected phrase “Testing one two three.” The speech synthesizer runs asynchronously, so as soon as the synthesizer starts speaking, the fourth Frame will be processed. This Frame performs the second servo move, with Servos 0 and 1 moving to their final position. The speech synthesizer will keep talking during this motion and after the Sequence has completed. A Frame can also contain multiple attributes, as in the following example: <Sequence Name="Example Sequence 3"> <Frame TimeToDestination="1" Delay="2" Speech="Hello!"> <ServoPosition Index="0" Position="800" /> <ServoPosition Index="1" Position="1200" /> </Frame> </Sequence>
.NET speech recognition library. In this example project, the speech vocabulary is stored in a file called ‘SpeechGrammar.xml’. This file contains a list of items, each in the following form: <item> <tag>NAME</tag> <one-of> <item> what's your name </item> <item> who are you </item> </one-of> </item> In this example, the ‘NAME’ tag is used to identify this vocabulary entry in the software. The “what’s your name” and “who are you” items specify the actual spoken phrases that the speech recognition should identify. So in this example, the user could say “what’s your name” or “who are you”, and either of these phrases would trigger the same ‘NAME’ vocabulary entry. In KinectManager, the SpeechRecognized event is triggered whenever the system recognizes a word or phrase from its vocabulary. A case statement then calls the robot motion sequence that has been assigned as the response to this speech input. Implementation of Speech Vocabulary There are four speech command vocabulary for speaking to the robot and robot will response in motion: When you speak “hello” or “hi” to the robot, robot will response with “Hi” and wave his left arm. When you speak either “Could you play some music by hand” or “Would you like play some music by hand” to the robot, robot will response with “Let me play some music” and play a random sequence of music by right hand. When you speak either “what's one plus two” or “what's one and two” or “one plus two” to the robot, robot will response with “It's so easy, of course three” and make the motion 3 with the finger. When you speak “what’s your name” or “who are you” to the robot, robot will response with “My name is Countess Robot” without motion.