示例#1
0
        public override IEnumerator RunTest()
        {
            if (Config.Instance.FindCredentials(m_TextToSpeech.GetServiceID()) == null)
            {
                yield break;
            }

            Text x = GameObject.Find("IFText").GetComponent <Text>();

            if (x.text == "")
            {
                m_TextToSpeech.ToSpeech("type something in the box below", OnSpeechPOST, true);
            }
            else
            {
                m_TextToSpeech.ToSpeech(x.text, OnSpeechPOST, true);
            }

            //m_TextToSpeech.ToSpeech("type something in the box below", OnSpeechPOST, true);            // Test POST
            while (!m_PostTested)
            {
                yield return(null);
            }

            yield break;
        }
示例#2
0
        public override IEnumerator RunTest()
        {
            if (Config.Instance.FindCredentials(m_TTS.GetServiceID()) == null)
            {
                yield break;
            }

            m_TTS.ToSpeech("Hello World using GET", OnSpeechGET);                    // Test GET
            while (!m_GetTested)
            {
                yield return(null);
            }

            m_TTS.ToSpeech("Hello World using POST", OnSpeechPOST, true);              // Test POST
            while (!m_PostTested)
            {
                yield return(null);
            }

            yield break;
        }
        public override IEnumerator RunTest()
        {
            m_CustomizationIDToTest         = Config.Instance.GetVariableValue("TextToSpeech_IntegrationTestCustomVoiceModel");
            m_UpdateWordObject0.word        = m_UpdateWord0;
            m_UpdateWordObject0.translation = m_UpdateTranslation0;
            m_UpdateWordObject1.word        = m_UpdateWord1;
            m_UpdateWordObject1.translation = m_UpdateTranslation1;

            if (Config.Instance.FindCredentials(m_TextToSpeech.GetServiceID()) == null)
            {
                yield break;
            }

            // Test GET
            m_TextToSpeech.ToSpeech("Hello World using GET", OnSpeechGET);
            while (!m_GetTested)
            {
                yield return(null);
            }

            // Test POST
            m_TextToSpeech.ToSpeech("Hello World using POST", OnSpeechPOST, true);
            while (!m_PostTested)
            {
                yield return(null);
            }

            //	Get Pronunciation
            string testWord = "Watson";

            Log.Debug("ExampleTextToSpeech", "Attempting to get pronunciation of {0}", testWord);
            m_TextToSpeech.GetPronunciation(OnGetPronunciation, testWord, VoiceType.en_US_Allison);
            while (!m_GetPronunciationTested)
            {
                yield return(null);
            }

            //  Get Customizations
            Log.Debug("ExampleTextToSpeech", "Attempting to get a list of customizations");
            m_TextToSpeech.GetCustomizations(OnGetCustomizations);
            while (!m_GetCustomizationsTested)
            {
                yield return(null);
            }

            //  Create Customization
            //Log.Debug("ExampleTextToSpeech", "Attempting to create a customization");
            //m_TextToSpeech.CreateCustomization(OnCreateCustomization, m_CustomizationToCreateName, m_CustomizationToCreateLanguage, m_CustomizationToCreateDescription);
            //while (!m_CreateCustomizationTested)
            //    yield return null;

            //  Get Customization
            Log.Debug("ExampleTextToSpeech", "Attempting to get a customization");
            if (!m_TextToSpeech.GetCustomization(OnGetCustomization, m_CustomizationIDToTest))
            {
                Log.Debug("ExampleTextToSpeech", "Failed to get custom voice model!");
            }
            while (!m_GetCustomizationTested)
            {
                yield return(null);
            }

            //  Update Customization
            Log.Debug("ExampleTextToSpeech", "Attempting to update a customization");
            Word[]            words             = { m_UpdateWordObject0 };
            CustomVoiceUpdate customVoiceUpdate = new CustomVoiceUpdate();

            customVoiceUpdate.words = words;
            if (!m_TextToSpeech.UpdateCustomization(OnUpdateCustomization, m_CustomizationIDToTest, customVoiceUpdate))
            {
                Log.Debug("ExampleTextToSpeech", "Failed to update customization!");
            }
            while (!m_UpdateCustomizationTested)
            {
                yield return(null);
            }

            //  Get Customization Words
            Log.Debug("ExampleTextToSpeech", "Attempting to get a customization's words");
            if (!m_TextToSpeech.GetCustomizationWords(OnGetCustomizationWords, m_CustomizationIDToTest))
            {
                Log.Debug("ExampleTextToSpeech", "Failed to get {0} words!", m_CustomizationIDToTest);
            }
            while (!m_GetCustomizationWordsTested)
            {
                yield return(null);
            }

            //  Add Customization Words
            Log.Debug("ExampleTextToSpeech", "Attempting to add words to a customization");
            Word[] wordArray   = { m_UpdateWordObject1 };
            Words  wordsObject = new Words();

            wordsObject.words = wordArray;
            if (!m_TextToSpeech.AddCustomizationWords(OnAddCustomizationWords, m_CustomizationIDToTest, wordsObject))
            {
                Log.Debug("ExampleTextToSpeech", "Failed to add words to {0}!", wordsObject);
            }
            while (!m_AddCustomizationWordsTested)
            {
                yield return(null);
            }

            ////  Get Customization Word
            Log.Debug("ExampleTextToSpeech", "Attempting to get the translation of a custom voice model's word.");
            if (!m_TextToSpeech.GetCustomizationWord(OnGetCustomizationWord, m_CustomizationIDToTest, m_UpdateWord1))
            {
                Log.Debug("ExampleTextToSpeech", "Failed to get the translation of {0} from {1}!", m_UpdateWord0, m_CustomizationIDToTest);
            }
            while (!m_GetCustomizationWordTested)
            {
                yield return(null);
            }

            //Delete Customization Word
            //Log.Debug("ExampleTextToSpeech", "Attempting to delete customization word from custom voice model.");
            //if (!m_TextToSpeech.DeleteCustomizationWord(OnDeleteCustomizationWord, m_CustomizationIdCreated, m_UpdateWord1))
            //    Log.Debug("ExampleTextToSpeech", "Failed to delete {0} from {1}!", m_UpdateWord1, m_CustomizationIdCreated);
            //while (!m_DeleteCustomizationWordTested)
            //    yield return null;

            //  Delete Customization
            //Log.Debug("ExampleTextToSpeech", "Attempting to delete a customization");
            //if (!m_TextToSpeech.DeleteCustomization(OnDeleteCustomization, m_CustomizationIdCreated))
            //    Log.Debug("ExampleTextToSpeech", "Failed to delete custom voice model!");
            //while (!m_DeleteCustomizationTested)
            //    yield return null;

            yield break;
        }