Created
January 26, 2015 21:16
-
-
Save dragthor/8e668ef1789186516884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void Image_PointerPressed(object sender, PointerRoutedEventArgs e) | |
{ | |
var img = e.OriginalSource as Windows.UI.Xaml.Controls.Image; | |
if (img == null) return; | |
var title = img.Tag as string; | |
// The object for controlling the speech-synthesis engine (voice). | |
var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer(); | |
var stream = await synth.SynthesizeTextToStreamAsync(title); | |
MediaElement mediaElement = this.media; | |
// Send the stream to the media object. | |
mediaElement.SetSource(stream, ""); | |
mediaElement.Play(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment