C#语音-创建一个循环并要求文本到语音合成器计数

问题描述 投票:0回答:1

我正在使用C#开发语音识别程序。我希望我的语音识别能够计算数字。这是我到目前为止尝试过的,

if (e.Result.Text == "count numbers")
        {
            for (int count = 1; count <= 10; count++)
            {
                speechSynthesizer.Speak(); // what should I put here?
                tbOutput.Text += count; 

            }

谢谢

c# winforms text-to-speech
1个回答
1
投票

使用count.ToString():

for (int count = 1; count <= 10; count++)
{
    speechSynthesizer.Speak(count.ToString());
    tbOutput.Text += count; 
}
© www.soinside.com 2019 - 2024. All rights reserved.