void Start()
    {
        watsonRecognizer = FindObjectOfType <MyStreaming>();
        watsonSpeaker    = FindObjectOfType <MyTextToSpeech>();
        myAssistant      = FindObjectOfType <MyAssistant>();

        // if(mainMenuPanel != null) mainMenuPanel.SetActive(true);

        sCam = FindObjectOfType <SCam>();
        scam.ChangeFade(exposure);

        //((PassportScenario)availableScenarios[1]).SetMainLogic(this);
        // availableScenarios[1].SaveAllToWav();

        //ChangeScenarioInto(0);
    }
示例#2
0
    void Start()
    {
        scam = cam.GetComponent <SCam>();

        aSource = GetComponent <AudioSource>();

        camPivot        = new GameObject("CamPivot");
        camPositionOrig = cam.transform.position;
        camRotationOrig = cam.transform.rotation;

        textToSpeech = FindObjectOfType <MyTextToSpeech>();

        lipAudioSource = textToSpeech.lipAudioSource;

        aniIns = FindObjectOfType <AnimatorInspector>();

        strings1 = new string[39];
        // Introduction about the project
        strings1[0] = "In this project, we implemented a Conversational Virtual Agent, that expresses OCEAN Personality and Emotions.";
        strings1[1] = "We make use of Laban Motion Analysis for modifying a base animation to express a specific personality.";
        strings1[2] = "Dialogue Choices and Auditory Parameters are adjusted to fit agent's personality features.";
        strings1[3] = "Words of the agent is analyzed for emotions that emerge as facial expressions.";

        // Used APIs and Libraries
        strings1[4] = "We use IBM Watson API for Natural Language Analysis, as well as Text-to-Speech and Speech-to-Text conversions.";
        strings1[5] = "Oculus Lip Sync is used for finding visemes of agent's speech, and BIO I.K. is used in solving Inverse Kinematics during animation modification.";
        strings1[6] = "The project is implemented in Unity using C Sharp.";

        // OCEAN Introduction
        strings1[7] = "In the OCEAN Model, personality of an individual is represented by five orthogonal dimensions.";
        strings1[8] = "These dimensions are Openness, Conscientiousness, Extraversion, Agreeableness and Neuroticism.";
        strings1[9] = "In our implementation, each OCEAN Feature of an agent has a value between negative and positive one.";

        // To Laban
        strings1[10] = "OCEAN Features are mapped into Laban Effort and Shape parameters in order to modify the base animation.";

        // Laban Shape
        strings1[11] = "Laban Shape Qualities define the change of body shape during movement in three different dimensions.";
        strings1[12] = "The Shape of motion can be Sinking or Rising, Enclosing or Spreading and Retreating or Advancing.";
        strings1[13] = "The base animation is altered to express a specific Laban Shape using Inverse Kinematics with varying weights in time.";

        strings1[14] = "Each Shape parameter has two Anchor points, and the I.K. targets of hands are calculated as a weighted sum of these Anchors.";
        strings1[15] = "The original distance of hands to each Anchor is considered to keep the essence of the base animation, preventing any dramatic changes.";
        strings1[16] = "Base animation is preprocessed to find the minimum and the maximum distance of each hand to each Anchor point, normalized using the absolute minimum and maximum distances.";
        strings1[17] = "Each Anchor attracts a hand's I.K. target proportional to the Shape parameters, multiplied with the current distance ratio to that Anchor.";

        // Laban Effort
        strings1[18] = "Laban Effort parameters define the qualities of a movement in four different dimensions.";
        strings1[19] = "We make use of Durupinar's findings to map OCEAN Features into Effort parameters.";

        strings1[20] = "Space component defines the attention towards environment, and it can be Direct or Indirect.";
        strings1[21] = "Arm rotations are scaled proportionally in order to shrink or expand the pose to compensate Space.";

        strings1[22] = "Weight component defines the influence of gravity on the body, and it can be Strong or Light.";
        strings1[23] = "Spine and leg rotations are adjusted in order to sink or rise the pose to compensate Weight.";

        strings1[24] = "Time component defines the urgency of the movement, and it can be Sudden or Sustained.";
        strings1[25] = "Current speed of the animation is scaled proportionally in order to make it faster or slower to compensate Time.";
        strings1[26] = "Speed of the base animation is preprocessed to calculate a speed scaling factor for each time frame, thus the altered speed of the animation appears more natural.";
        strings1[27] = "The base animation is sampled with a constant frame rate, and in each time frame, hand displacements are calculated as a measure of speed.";
        strings1[28] = "Speed in each time frame is ranked in ascending order, and speed scaling factor for a time frame is calculated by its rank divided by the number of time frames.";

        strings1[29] = "Flow component defines the amount of control in the movement, and it can be Bound or Free.";
        strings1[30] = "Idle pose is blended into the animation to create Bound Flow.";
        strings1[31] = "Rotational fluctuations are added to create Free Flow.";
        strings1[32] = "We use circular walks on Perlin Noise texture to calculate continuous patterns with variation, in order to generate additive rotations for each limb.";
        strings1[33] = "Speed of fluctuations are controlled by Neuroticism and Extraversion, whereas Conscientiousness determines the magnitude.";

        // Additional Movement Parameters
        strings1[34] = "We also make use of various Nonverbal Communication Cues to enhance the personality of the agent.";
        strings1[35] = "Blink Speed and Ratio is determined by Neuroticism and Extraversion.";
        strings1[36] = "Look Target of the agent deviates based on Extraversion and Conscientiousness, to mimic attention and eye contact.";
        strings1[37] = "Hands open or close on different levels based on Neuroticism and Openness, and fingers animate with different speeds based on Neuroticism.";
        strings1[38] = "During agent's thinking process eyes deviate based on Conscientiousness.";

        // Facial Expression and Auditory Parameters
        strings2    = new string[7];
        strings2[0] = "The agent is capable of showing facial expressions.";
        strings2[1] = "Using IBM Watson Natural Language Understanding, sentences of the agent are mapped into emotion parameters.";
        strings2[2] = "Values for Joy, Anger, Disgust, Sadness and Fear is found.";
        strings2[3] = "These values are then mapped into facial expression parameters: Happiness, Sadness, Angriness, Surprise, Disgust and Fear.";
        strings2[4] = "Using shape keys of face parts facial expression is animated, based on a factor that is determined by Extraversion.";
        strings2[5] = "Auditory Parameters are adjusted according to mappings of Polzehl.";
        strings2[6] = "IBM Watson Text-to-Speech supports transforming the following Auditory Parameters:";

        // Agent Talk Examples
        talkStrings     = new string[11];
        talkStrings[0]  = "I am able to speak with a low pitch.";
        talkStrings[1]  = "Or I can speak with a high pitch.";
        talkStrings[2]  = "My pitch range can be wide.";
        talkStrings[3]  = "Or I can speak with a narrow pitch range.";
        talkStrings[4]  = "It is possible for me to speak with a high rate.";
        talkStrings[5]  = "Or with a low rate.";
        talkStrings[6]  = "Breathiness of my voice could be high.";
        talkStrings[7]  = "Or I can speak with low breathiness.";
        talkStrings[8]  = "I can speak with high glottal tension.";
        talkStrings[9]  = "Or it is possible for me to speak with low glottal tension.";
        talkStrings[10] = "Adjusting my voice features according to OCEAN Features help me to express my personality in a better way.";

        // Scenarios and FlowChart
        strings3    = new string[20];
        strings3[0] = "We test our system with three different scenarios.";
        strings3[1] = "In each scenario user takes turns to communicate with the agent.";
        strings3[2] = "A turn starts with user talking into the microphone, and ends with agent giving an appropriate response.";
        strings3[3] = "Speech-to-Text system converts user speech into a string, and then the meaning is extracted through Watson Assistant.";

        strings3[4] = "Watson Assistant is a Machine Learning based API, trained with example sentences to output a predefined Intent and occurring Entities.";

        strings3[5] = "According to the found intent, the scenario manager chooses a base animation and a dialogue sentence for the agent.";
        strings3[6] = "All dialogue sentences have ten different Alternatives, representing each positive and negative OCEAN dimension.";

        strings3[7]  = "These Alternatives are handcrafted based on the findings of Mairesse.";
        strings3[8]  = "In his research, various features of a sentence are analyzed for estimating personality, and the correlations are given for both ends of each OCEAN dimension.";
        strings3[9]  = "As an example, a person with low Extraversion will use more formal language, more negative words and less swear words; will have many pauses and will focus less on human related topics.";
        strings3[10] = "Although automatic generation could be a possibility, we leave it as a future interest.";

        strings3[11] = "Although a person expresses all five dimensions of OCEAN, we assume in one line of dialogue one dimension is expressed dominantly.";
        strings3[12] = "A probability for each Alternative is calculated based on OCEAN Features of the agent.";
        strings3[13] = "An agent with very high extraversion, for example, would choose Positive Extraversion Alternative most of the time, and will never choose Negative Extraversion Alternative.";

        strings3[14] = "Using Natural Language Understanding emotions are found for the chosen Alternative.";
        strings3[15] = "Emotion parameters are then used for the facial expression of the agent, and they decay with time.";

        strings3[16] = "Dialogue sentence of the agent is vocalized using Text-to-Speech API, with speech parameters extracted from OCEAN personality of the agent.";
        strings3[17] = "Oculus Lip Sync is used for finding Visemes of the agent's speech, and these are blended into facial shape keys of the agent.";
        strings3[18] = "Base animation of the agent is modified first using the I.K. Solver, and then Animation Processor applies rotations and shape key changes to produce the final animation.";
        strings3[19] = "A new turn starts when the final animation and the generated speech finishes playing.";
    }