Exemple #1
0
        public ASRApi BuildASR()
        {
            if (_settings == null)
            {
                throw new Exception("App setting can not null.");
            }
            if (string.IsNullOrEmpty(_language))
            {
                throw new Exception("Language set can not null.");
            }
            Model.IAT.CommonParams common = new Model.IAT.CommonParams()
            {
                app_id = _settings.AppID,
                uid    = _uid,
            };
            Model.IAT.DataParams data = new Model.IAT.DataParams()
            {
                format   = _format,
                encoding = _encoding
            };
            Model.IAT.BusinessParams business = new Model.IAT.BusinessParams()
            {
                language = _language,
                domain   = _domain,
                accent   = _accent,
                vad_eos  = _vad_eos,
            };
            _settings.ApiType = Enum.ApiType.ASR;

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

            api.OnError   += _onError;
            api.OnMessage += _onMessage;
            return(api);
        }
Exemple #2
0
        public FirstFrameData()
        {
            data     = new DataParams();
            business = new BusinessParams();
            common   = new CommonParams();

            data.status = FrameState.First;
        }