Ejemplo n.º 1
0
 private async void GenerateToken()
 {
     if (await _textToSpeak.GenerateAuthenticationToken("BING_SPEECH_API_KEY"))
     {
         _textToSpeak.GenerateHeaders();
     }
 }
        /// <summary>
        /// Constructor for MainViewModel. Creates the required API clients, and ICommand objects
        /// </summary>
        public MainViewModel()
        {
            StatusText = "Status: Waiting for image...";

            _faceServiceClient = new FaceServiceClient("FACE_API_KEY_HERE");

            BrowseButtonCommand = new DelegateCommand(Browse);
            DetectFaceCommand   = new DelegateCommand(DetectFace, CanDetectFace);

            _textToSpeak = new TextToSpeak();
            _textToSpeak.OnAudioAvailable += _textToSpeak_OnAudioAvailable;
            _textToSpeak.OnError          += _textToSpeak_OnError;

            if (_textToSpeak.GenerateAuthenticationToken("Chapter1", "BING_SPEECH_KEY_HERE"))
            {
                _textToSpeak.GenerateHeaders();
            }
        }