Exemplo n.º 1
0
        async void OnLoaded(object sender, RoutedEventArgs e)
        {
            _messageLabel.Text = "Hello";

            _faceTracker = await FaceTracker.CreateAsync();

            _speechEngine.PhraseRecognized += OnspeechEnginePhraseRecognized;
            _speechEngine.StateChanged     += OnSpeechEngineStateChanged;

            await _speechEngine.StartContinuousRecognitionAsync();

            //await Task.WhenAll(//ChangeStreamStateAsync(true));,
            //                   InitializeSpeechRecognizerAsync());

            //var iPod = await Bluetooth.PairAsync();

            //if (iPod != null)
            //{
            //    var device = await Bluetooth.FromIdAsync(iPod.Id);
            //    if (device != null)
            //    {

            //    }
            //}
        }
        async void OnLoaded(object sender, RoutedEventArgs e)
        {
            _messageLabel.Text = GetTimeOfDayGreeting();

            // I want these to be serialized.
            foreach (var loader in new IAsyncLoader[]
            {
                _currentWeather,
                _forecastWeather,
                _eventCalendar
            }.Where(loader => loader != null))
            {
                await loader.LoadAsync();
            }

            _speechEngine.PhraseRecognized += OnSpeechEnginePhraseRecognized;
            _speechEngine.StateChanged     += OnSpeechEngineStateChanged;
            _speaker.Volume = .5;

            await _speechEngine.StartContinuousRecognitionAsync();
        }