SpeechSynthesizer takes forever to synthesize. #8269
-
I am not sure if it is a bug of this library. I have a method var synth = new SpeechSynthesizer();
var player = new MediaPlayer();
SetVoice(language, ref synth);
var source = await synth.SynthesizeTextToStreamAsync(text);
player.SetStreamSource(source);
synth.Dispose();
player.MediaEnded += (_, _) => { source.Dispose(); player.Dispose(); }
player.Play(); If I call this method twice with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
MediaPlayer and SpeechSynthesizer are under the Windows root namespace. They are in the namespaces Windows.Media.Playback and Windows.Meedia.SpeechSynthesis respectively. This means they are part of Windows' functionality and therefore this isn't really the correct place to ask this. However, I did mess around a little to see if I could get something working, and:
Yes, this is C++, but calling this in response to the left mouse click worked without issue. So I would guess that your code is deadlocking. |
Beta Was this translation helpful? Give feedback.
-
This test works for me :
with
|
Beta Was this translation helpful? Give feedback.
MediaPlayer and SpeechSynthesizer are under the Windows root namespace. They are in the namespaces Windows.Media.Playback and Windows.Meedia.SpeechSynthesis respectively. This means they are part of Windows' functionality and therefore this isn't really the correct place to ask this.
However, I did mess around a little to see if I could get something working, and: