Esempio n. 1
0
        async Task SpeakTextAsync(string text, MediaElement mediaElement)
        {
            //TODO: ARS use link below to stop async tasks
            //https://stackoverflow.com/questions/15614991/simply-stop-an-async-method
            IRandomAccessStream stream = await SynthesizeTextToSpeechAsync(text);

            //here try stoping timer
            repeatDispTimer.Stop();
            await mediaElement.PrompterPlayStreamAsync(stream, true);

            repeatDispTimer.Start();
        }
Esempio n. 2
0
        async Task SpeakTextAsync(string text, MediaElement mediaElement)
        {
            //TODO: ARS use link below to stop async tasks
            //https://stackoverflow.com/questions/15614991/simply-stop-an-async-method

            //if(TgsRepeats.IsOn)
            //{
            //    BtnStopPauseRepeatMediaOutAsync.Visibility = Visibility.Visible;
            //    BtnRepeatMediaOutAsync.Visibility = Visibility.Collapsed;
            //    stpStatus.Visibility = Visibility.Visible;
            //}
            //   IRandomAccessStream stream = await this.SynthesizeTextToSpeechAsync(text);
            IRandomAccessStream stream = await SynthesizeTextToSpeechAsync(text);

            await mediaElement.PrompterPlayStreamAsync(stream, true);
        }