Reputation: 49
I receive an error in SpeechSynthesizer, it says:
Error: 'await' requires that the type 'Windows.Foundation.IAsynAction' have a suitable GetAwaiter method. Are you missing directive for 'System'?
I use plain text, my code goes like this
await synth.SpeakTextAsync(titleTextBox.Text);
Upvotes: 1
Views: 165
Reputation: 1576
Add async
keyword to the method header.
private async void MethodName()
{
var synth = new SpeechSynthesizer();
await synth.SpeakTextAsync(titleTextBox.Text);
}
Upvotes: 1