Exemple #1
0
        private async Task CheckSynthesisTask(string id, EventWaitHandle waitHandle)
        {
            var task = await _pollyClient.GetSpeechSynthesisTaskAsync(new GetSpeechSynthesisTaskRequest { TaskId = id });

            if (task.SynthesisTask.TaskStatus != Amazon.Polly.TaskStatus.InProgress && task.SynthesisTask.TaskStatus != Amazon.Polly.TaskStatus.Scheduled)
            {
                waitHandle.Set();
            }
        }
 private Amazon.Polly.Model.GetSpeechSynthesisTaskResponse CallAWSServiceOperation(IAmazonPolly client, Amazon.Polly.Model.GetSpeechSynthesisTaskRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Polly", "GetSpeechSynthesisTask");
     try
     {
         #if DESKTOP
         return(client.GetSpeechSynthesisTask(request));
         #elif CORECLR
         return(client.GetSpeechSynthesisTaskAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }