![](/img/trans.png)
[英]Using Microsoft.CognitiveServices.Speech.SpeechSynthesizer how to capture when is done speaking in C#
[英]Resizing Text while SpeechSynthesizer is speaking C#
我想知道在.NET Microsoft語音合成器講話時,是否有人可以告訴我如何基本上調整標簽或圖像的大小。
目的是隨着合成器的說話,使中間的文本越來越大。 因此,如果音高較高,則文本較大,而音調較低,則文本較小等。
在合成器講話時有什么方法可以做到這一點? 我已經嘗試過使用SpeakStarted和SpeakComplted事件來調整文本的大小,但是它是靜態的-在合成器講話時它不會改變。
我真的很感謝您的幫助。
我在C#WPF中對此進行編程。
非常感謝。
訂閱SpeakProgress或StateChanged事件怎么樣? SpeakProgress是“在說出提示的單個單詞后引發的。”,StateChanged提供了“已暫停,就緒或正在講話”的選項。 https://msdn.microsoft.com/zh-CN/library/hh362940%28v=office.14%29.aspx
SpeechSynthesizer synth = new SpeechSynthesizer();
// Add a handler for the SpeakProgress event.
synth.SpeakProgress +=
new EventHandler<SpeakProgressEventArgs>(synth_SpeakProgress);
// Write each word and its character position to the console.
static void synth_SpeakProgress(object sender, SpeakProgressEventArgs e)
{
Console.WriteLine("Speak progress: {0} {1}", e.CharacterPosition, e.Text);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.