Esempio n. 1
0
        public TTSApi BuildTTS()
        {
            if (_settings == null)
            {
                throw new Exception("App setting can not null.");
            }
            Model.TTS.CommonParams common = new Model.TTS.CommonParams()
            {
                app_id = _settings.AppID,
                uid    = _uid,
            };
            Model.TTS.DataParams data = new Model.TTS.DataParams()
            {
                text = "",
            };
            Model.TTS.BusinessParams business = new Model.TTS.BusinessParams()
            {
                ent    = _ent,
                aue    = _aue,
                auf    = _auf,
                vcn    = _vcn,
                speed  = _speed,
                volume = _volume,
                tte    = _tte
            };
            _settings.ApiType = Enum.ApiType.TTS;

            TTSApi api = new TTSApi(_settings, common, data, business);

            api.OnError   += _onError;
            api.OnMessage += _onMessage;
            return(api);
        }
Esempio n. 2
0
        /// <summary>
        /// TTS配置参数
        /// </summary>
        /// <param name="business"></param>
        /// <returns></returns>
        public ApiBuilder WithBusinessParams(Model.TTS.BusinessParams business)
        {
            if (business != null)
            {
                _ent    = business.ent;
                _aue    = business.aue;
                _auf    = business.auf;
                _vcn    = business.vcn;
                _speed  = business.speed;
                _volume = business.volume;
                _tte    = business.tte;
            }

            return(this);
        }