Hello,
Welcome to Microsoft Q&A!
Take a look at TaskCompletionSource , It enables the creation of a task that can be handed out to consumers.
Sample
public Task<string> MyTask()
{
var tcs = new TaskCompletionSource<string>();
{
//OnResult call back
tcs.SetResult(Words);
}
return tcs.Task;
}
BTW , I would suggest you use official sample for SpeechToText.
We could handle the callback in OnActivityResult method in activity.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.