1

I encounter an exception with Amazon Transcribe when I try to get the transcription result. I haven't found a way to pass a callback or receive a notification when the transcription is done. So I regularly check if the result is available.

Here is my code:

var getTranscriptionJobRequest = new GetTranscriptionJobRequest()
{
    TranscriptionJobName = fileName
};

// Regularly check the request status
GetTranscriptionJobResponse getTranscriptionJobResponse;
do
{
  Thread.Sleep(250); // Wait 250 ms
  getTranscriptionJobResponse = amazonTSClient.GetTranscriptionJob(getTranscriptionJobRequest);
}
while (getTranscriptionJobResponse.TranscriptionJob.TranscriptionJobStatus != TranscriptionJobStatus.COMPLETED);

And here is the exception:

Amazon.TranscribeService.AmazonTranscribeServiceException: 'Rate exceeded'

I found here that the error is due to too many requests to the AWS API.

So, my question is:

Is it possible to be notified when the transcription result is available? Or if not, what is the maximum call rate to the AWS API?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Jeankowkow
  • 814
  • 13
  • 33
  • I don't know amazon, but it looks like you are starting the job every 250 ms. – Palle Due Jun 11 '18 at 09:32
  • No, I get the result object from AWS to check its status every 250 ms. The job is started before with this code: `amazonTSClient.StartTranscriptionJobAsync(new StartTranscriptionJobRequest() { /*...*/ });` – Jeankowkow Jun 11 '18 at 09:41

1 Answers1

0

Notification from AWS Transcribe relies on its integration with AWS CloudWatch. Example cloud watch rule:

{
  "source": [
    "aws.transcribe"
  ],
  "detail-type": [
    "Transcribe Job State Change"
  ],
  "detail": {
    "TranscriptionJobStatus": [
      "COMPLETED",
      "FAILED"
    ]
  }
}

Resulting event in CloudWatch:

 {
   "version": "0",
   "id": "event ID",
   "detail-type":"Transcribe Job State Change",
   "source": "aws.transcribe",
   "account": "account ID",
   "time": "timestamp",
   "region": "region",
   "resources": [],
   "detail": {
     "TranscriptionJobName": "unique job name",
     "TranscriptionJobStatus": "status"
   }
 }

More info:

If polling instead, the maximum call rate of GetTranscriptionJob is ~3 per second. That and other rate limits are documented here:

kaliatech
  • 17,579
  • 5
  • 72
  • 84
  • `detail` always returns null for me :( here's the response I get `'version' => '0', 'id' => '1fa5cca6-413f-4a0f-0ba2-66efa49c247e', 'detail-type' => 'Transcribe Job State Change', 'source' => 'aws.transcribe', 'account' => '405723091079', 'time' => '2019-11-19T19:04:25Z', 'region' => 'eu-west-1', 'detail' => NULL, ` – Steven Grant Nov 19 '19 at 19:17
  • Strange. I just ran a quick test and I do get a valid detail. Can you use the AWS console to verify the job completed successfully? How are you acquiring that response? i.e. I used a simple SNS topic to email it to myself. Consider posting this as a new question on SO for better visibility. – kaliatech Nov 20 '19 at 16:12