Beispiel #1
0
        async void enterButton_Click(object sender, RoutedEventArgs e)
        {
            var text = result.Text;

            if (text.StartsWith(">"))
            {
                _comPort = text.Substring(1);
                _connection?.Close();
                _connection = null;
            }

            result.SelectAll();

            var connection = await GetDeviceAsync();

            var stream = await _engine.SayText(text);

            TheMedia.SetSource(stream, stream.ContentType);
            var task = connection?.PlayAnimationSequenceAsync(stream.Markers);

            TheMedia.Play();
        }
Beispiel #2
0
        async void OnPlayClicked(object sender, RoutedEventArgs e)
        {
            var text = TheTextBox.Text;

            TheTextBox.SelectAll();

            var stream = await _engine.SayText(text);

            foreach (var mark in stream.Markers)
            {
                Debug.WriteLine($"{mark.Text} @ {mark.Time.Milliseconds}ms");
            }

            TheMedia.SetSource(stream, stream.ContentType);
            TheMedia.Play();
        }