Example #1
0
        //朗读选中文本
        private async void OnRead(string text)
        {
            if (text != "")
            {
                SpeechSynthesizer     synthesizer = new SpeechSynthesizer();
                SpeechSynthesisStream stream      = await synthesizer.SynthesizeTextToStreamAsync(text);

                //Me为MediaElement AutoPlay true;
                PronunciationPlayer.SetSource(stream, stream.ContentType);
            }
        }