1

我在 SpeechSynthesizer 中收到一个错误,它说:

错误:“await”要求“Windows.Foundation.IAsynAction”类型具有合适的 GetAwaiter 方法。您是否缺少“系统”的指令?

我使用纯文本,我的代码是这样的

await synth.SpeakTextAsync(titleTextBox.Text);
4

1 回答 1

1

async关键字添加到方法头。

    private async void MethodName()
    {
        var synth = new SpeechSynthesizer();
        await synth.SpeakTextAsync(titleTextBox.Text);
    }
于 2014-03-01T10:13:40.353 回答