Exemple #1
0
    // Use this for initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "2c890cf705f14c859fcdb438300d88eb";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;
    }
Exemple #2
0
    // Use this for initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "3485a96fb27744db83e78b8c4bc9e7b7";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;

        tts = new TextToSpeech(TextToSpeech.Locale.ES);
    }
    // Initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };
        const string SUBSCRIPTION_KEY = "16f5bce1-7673-493e-9a85-ecc4921ad29d";
        const string ACCESS_TOKEN     = "f55f28edf93e4118b73b78e4271b5d39";

        var config = new AIConfiguration(SUBSCRIPTION_KEY, ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnResult += HandleOnResult;
        apiAiUnity.OnError  += HandleOnError;
    }
    IEnumerator Start()
    {
        ass = gameObject.GetComponent <AudioSource>();
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "5e8b3253362c4f038ce24e40a650271f";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;
    }
Exemple #5
0
    // Use this for initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "f5ac8103d7da44fbb15a512990ecd204"; // Identificador de DialogFlow

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        text_to_speech = GetComponent <TextToSpeech>(); // Se inicializa el TTS

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;

        SendText("Garrotazos");
        SendText("Goya");
    }
Exemple #6
0
    // Use this for initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string SUBSCRIPTION_KEY = "cb9693af-85ce-4fbf-844a-5563722fc27f";
        const string ACCESS_TOKEN     = "3485a96fb27744db83e78b8c4bc9e7b7";

        var config = new AIConfiguration(SUBSCRIPTION_KEY, ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;
    }
Exemple #7
0
    void Start()
    {
        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => {
            return(true);
        };

        var config = new AIConfiguration(accessToken, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
Exemple #8
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("API AI Initialized.");

        const string ACCESS_TOKEN = "c1cb6e5396d04d6e8b1215ac0cfd55ac";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        SendText("Do you know what is the definition of insanity is?");
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "3d546d5451bc4c498b77dfc361f1256e";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "937df1a477c3487b922a953bf4892684  ";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
Exemple #11
0
    // Use this for initialization
    void Start()
    {
        // check access to the Microphone

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => {
            return(true);
        };
        const string ACCESS_TOKEN = "4d441b4ca3f5429b9377adaabb6b7e6b";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
Exemple #12
0
    // Use this for initialization
    void Start()
    {
        // check access to the Microphone

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };
        const string ACCESS_TOKEN = "e5441c4efaba448a95890c4b3eb3e42e";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.Spanish);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
    void Start()
    {
        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "0841d56a1f304f318d207aa46cb569cd";

        animRespond = false;
        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        n          = GameObject.FindGameObjectWithTag("Narrator").GetComponent <Narrator>();
        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
    }
    // Use this for initialization
    IEnumerator Start()
    {
        // make sure the recordingtext is off
        RecordingText.SetActive(false);

        // Init MoveCamera location
        MoveCamera moveCamera = GetComponent <MoveCamera>();

        moveCamera.UpdateLocation("espoo");

        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string SUBSCRIPTION_KEY = "8a414957-b4a9-45e7-8af7-d942f77ff7ff";
        const string ACCESS_TOKEN     = "7cbe30ec8f6342fbb2c2e8baa80dec3e";

        var config = new AIConfiguration(SUBSCRIPTION_KEY, ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;

        landmarks = new Dictionary <string, Landmark>();

        landmarks.Add("Helsinki Cathedral", new Landmark("Helsinki Cathedral", "church"));
        landmarks.Add("Design Factory", new Landmark("Design Factory", "espoo"));
        landmarks.Add("Fortress of Finland", new Landmark("Fortress of Finland", "suomenlinna"));
        landmarks.Add("FJORD Helsinki", new Landmark("FJORD Helsinki", "fjord"));

        //landmarks.Add( "The University of Helsinki",  new Landmark("The University of Helsinki", "university"));
        //landmarks.Add( "The Senate Square",           new Landmark("The Senate Square",          "square"));
    }
Exemple #15
0
    // Use this for initialization
    IEnumerator Start()
    {
        // check access to the Microphone
        yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone));

        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "3485a96fb27744db83e78b8c4bc9e7b7";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        apiAiUnity.OnError  += HandleOnError;
        apiAiUnity.OnResult += HandleOnResult;

        foodImage = foodItem.GetComponent <Image>();
        if (Application.loadedLevelName == "Play")
        {
            returnFood = foods[index];
        }
        else
        {
            returnBathObj        = bathroomObj[index];
            answerTextField.text = returnBathObj;
            audioSource.clip     = soapAudio;
        }

        answerTextField.color = Color.clear;

        timer = 0;
    }
Exemple #16
0
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        AddSpeechPluginListener();
        AddTextToSpeechListener();

        apiaiClient = new ApiAiUnity();
        apiaiClient.Initialize(new AIConfiguration("a984bc306ae24d11b4105e251f892a21", SupportedLanguage.English));
    }
Exemple #17
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("API AI Initialized.");

        const string ACCESS_TOKEN = "c1cb6e5396d04d6e8b1215ac0cfd55ac";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.English);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);

        //SendText("Do you know what is the definition of insanity is?");
        Recognitions.text = "";

        DictationRecognizer = new DictationRecognizer();

        DictationRecognizer.DictationResult += (text, confidence) =>
        {
            Debug.LogFormat("Dictation result: {0}", text);
            Recognitions.text = text;
            SendText(text);
        };

        DictationRecognizer.DictationComplete += (completionCause) =>
        {
            if (completionCause != DictationCompletionCause.Complete)
            {
                Debug.LogErrorFormat("Dictation completed unsuccessfully: {0}.", completionCause);
            }
        };

        DictationRecognizer.DictationError += (error, hresult) =>
        {
            Debug.LogErrorFormat("Dictation error: {0}; HResult = {1}.", error, hresult);
        };

        DictationRecognizer.Start();

        WindowsVoice.speak("shut up");
    }
Exemple #18
0
    // Use this for initialization
    private void Awake()

    {
        // check access to the Microphone
        //yield return Application.RequestUserAuthorization(UserAuthorization.Microphone);
        if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            throw new NotSupportedException("Microphone using not authorized");
        }

        ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) =>
        {
            return(true);
        };

        const string ACCESS_TOKEN = "3634f11198d345b5aee6a88ec6a93065";

        var config = new AIConfiguration(ACCESS_TOKEN, SupportedLanguage.German);

        apiAiUnity = new ApiAiUnity();
        apiAiUnity.Initialize(config);
        apiAiUnity.OnError += HandleOnError;
    }