Saturday, February 22, 2014

WinRT SpeechSynthesizer not playing entire phrase

I am developing a Windows Store app which uses Windows.Media.SpeechSynthesis. The code is quite simple AND works perfectly on x86 and x64. However on an ARM tablet (I am testing on Microsoft Surface 2) the audio generally (but not always) only plays partially. What I mean by that is that the first second or so of audio is missing; there is a pause followed by the last part of the phrase only. So if the text is just a few words, nothing will play at all.



MediaElement mediaElement = new MediaElement();
var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
SpeechSynthesisStream stream = await synth.SynthesizeTextToStreamAsync"Hello");
mediaElement.SetSource(stream, stream.ContentType);
mediaElement.Play();

I have checked that the MediaElement.CurrentState is Opening before playback. Any ideas would be appreciated.


No comments:

Post a Comment