locked
WinRT SpeechSynthesizer not playing entire phrase

    Question

  • 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.

    Tuesday, February 11, 2014 1:33 AM

All replies

  • I am not able to reproduce this on my Surface RT. Do you have any other machines on which this reproduces?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, February 11, 2014 3:28 PM
    Moderator
  • After further testing it seems to fail only when playing to a Bluetooth receiver. Perhaps some sort of handshake is taking place which delays reproduction of the audio and it therefore misses the first part of the stream.

    Wednesday, February 12, 2014 12:50 AM
  • Can you post a repro app to me to test? I wouldn't mind repro'ing this and filing a bug.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, February 20, 2014 5:57 PM
    Moderator
  • Thanks for trying to help Matt. We conducted further tests with alternative Bluetooth audio and did not experience the same problem. We then tested the original audio device with a 64-bit PC and did get the problem. So it is hardware-specific (and may not be too widespread). We also tried sending a 'silent' phrase, then only the real phrase on the MediaEnded event, which worked. It seems that this device (Logitech UE Boombox), and maybe others, needs a delay whilst the channel is opened. So I'm not sure that warrants a bug report.
    Sunday, February 23, 2014 3:42 AM