private async void GenerateHeaders()
 {
     if (await _ttsClient.GenerateAuthenticationToken(_bingApiKey))
     {
         _ttsClient.GenerateHeaders();
     }
 }
Exemplo n.º 2
0
        public LuisViewModel()
        {
            _bingSearch = new BingSearch();

            _visionClient = new VisionServiceClient("FACE_API_KEY");

            _luis = new Luis(new LuisClient("LUIS_APP_ID", "LUIS_API_KEY", true));
            _luis.OnLuisUtteranceResultUpdated += OnLuisUtteranceResultUpdated;

            _sttClient = new SpeechToText(_bingApiKey);
            _sttClient.OnSttStatusUpdated += OnSttStatusUpdated;

            _ttsClient = new TextToSpeech();
            _ttsClient.OnAudioAvailable += OnTtsAudioAvailable;
            _ttsClient.OnError          += OnTtsError;

            if (_ttsClient.GenerateAuthenticationToken("SmartHouseApp", _bingApiKey))
            {
                _ttsClient.GenerateHeaders();
            }

            RecordUtteranceCommand  = new DelegateCommand(RecordUtterance);
            ExecuteUtteranceCommand = new DelegateCommand(ExecuteUtterance, CanExecuteUtterance);
        }