Пример #1
0
        public long Synthesize(PostSynthesizeRequest synthesizeRequest)
        {
            string uri = Constants.POST_TEXT_SYNTHESIZE;

            uri += Constants.API_KEY_PARAM + _gcTextToSpeech.apiKey;

            return(_networking.SendRequest(uri, JsonConvert.SerializeObject(synthesizeRequest), NetworkEnumerators.RequestType.POST,
                                           new object[] { Enumerators.GoogleCloudRequestType.SYNTHESIZE }));
        }
        public void Synthesize(PostSynthesizeRequest synthesizeRequest)
        {
            string uri = Constants.POST_TEXT_SYNTHESIZE;

            if (!_gcTextToSpeech.isUseAPIKeyFromPrefab)
            {
                uri += Constants.API_KEY_PARAM + Constants.GC_API_KEY;
            }
            else
            {
                uri += Constants.API_KEY_PARAM + _gcTextToSpeech.apiKey;
            }

            _networking.SendRequest(uri, JsonConvert.SerializeObject(synthesizeRequest), NetworkEnumerators.RequestType.POST,
                                    new object[] { Enumerators.GoogleCloudRequestType.SYNTHESIZE });
        }