Exemple #1
0
        private static void VoiceTestGetByProjectId(Dictionary <string, string> arguments)
        {
            string subscriptionKey = arguments["subscriptionkey"];
            string hostURI         = arguments["hosturi"];
            string projectId       = arguments["projectid"];

            var result = VoiceTest.GetByProjectId(subscriptionKey, hostURI, projectId);

            DisplayResult <API.DTO.VoiceTest>(result);
        }
Exemple #2
0
        private static void VoiceTestDeleteById(Dictionary <string, string> arguments)
        {
            string subscriptionKey = arguments["subscriptionkey"];
            string hostURI         = arguments["hosturi"];
            string voiceTestId     = arguments["voicetestid"];

            if (VoiceTest.DeleteById(subscriptionKey, hostURI, voiceTestId))
            {
                Console.WriteLine("Delete voice test successfully");
            }
            else
            {
                Console.WriteLine("Delete voice test failed");
            }
        }
    // Start is called before the first frame update
    public void Start()
    {
#if PLATFORM_ANDROID
        if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
        {
            Permission.RequestUserPermission(Permission.Microphone);
        }
#endif
        //voiceTest = new VoiceTest();
        voiceC    = this.transform.GetChild(2).gameObject;
        voiceTest = voiceC.GetComponent <VoiceTest>();
        VoiceController voiceController = voiceC.GetComponent <VoiceController>();
        voiceTest.InitPluin();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        pandaBot            = new pandaAIMLBot();
        pandaBot.Start();
        speechController = new myvoiceController();
        var aSources = GetComponents <AudioSource>();
        userAudioSource                  = aSources[0];
        pandaOutputAudioSource           = aSources[1];
        originalPosition                 = gameObject.transform.position;
        originalRotationValue            = transform.rotation;
        speechController.audioSource     = pandaOutputAudioSource;
        speechController.myHandleTextBox = myHandleTextBox;
        animator = GetComponent <Animator>();
        speechController.animator = animator;
        robotOutput.text          = "Hi, I am panda bot. How can I help you?";
        Debug.Log(robotOutput.text);
        if (voiceTest.isIntialised())
        {
            //StartCoroutine(voiceTest.TTS(robotOutput.text));
            voiceTest.TTS(robotOutput.text);
        }
        else
        {
            StartCoroutine(speechController.sendRequestToRSSAndPlayAudio(robotOutput.text));
        }
        animator.Play("talking");
        animator.Play("waving");
        clipSampleData       = new float[1024];
        userAudioSource.clip = null;
        //Invoke("voiceTest.TTS(robotOutput.text)", 1);
        Idle();
    }
Exemple #4
0
        private static void VoiceTestCreate(Dictionary <string, string> arguments)
        {
            string subscriptionKey = arguments["subscriptionkey"];
            string hostURI         = arguments["hosturi"];
            string projectId       = arguments["projectid"];
            string modelId         = arguments["modelid"];
            string script          = arguments["script"];
            bool   isSSML          = false;

            if (arguments.Keys.ToList().Contains("isssml"))
            {
                isSSML = Convert.ToBoolean(arguments["isssml"]);
            }

            if (VoiceTest.Create(subscriptionKey, hostURI, new Guid(projectId), new Guid(modelId), script, isSSML))
            {
                Console.WriteLine("Create voice test successfully");
            }
            else
            {
                Console.WriteLine("Create voice test failed");
            }
        }