aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

The StartTranscriptionJobAsync callback is called only once and the response status is IN PROGRESS

Open bsbontchev opened this issue 5 years ago • 4 comments

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug After the StartTranscriptionJobAsync is called the supplied callback is called only once as per SDK docs:

  • Starts an asynchronous job to transcribe speech to text.
  • Queues the request into a thread executor and triggers associated callback when operation has finished. The StartTranscriptionJobOutcome response is success. The TranscriptionJob status is IN PROGRESS. A response/job with a status either FAILED or COMPLETED is never delivered. The transcription job is completed according to the AWS Transcription jobs console.

SDK version number 1.8.21

Platform/OS/Hardware/Device CentOS 7.0

To Reproduce (observed behavior) Call the StartTranscriptionJobAsync with a valid request and callback. In the callback print the number of responses and their status.

Expected behavior The asynch transcription callback either to be called only once with a response having status FAILED or COMPLETED or many times where the the last call to be with status FAILED or COMPLETED.

Logs/output aws_sdk_2020-09-15-21.log

Additional context Add any other context about the problem here.

bsbontchev avatar Sep 16 '20 15:09 bsbontchev

hey @bsbontchev , Could you provide a small sample code that reproduces the error? I'm not sure I quite get the problem and it'd be much clearer if I could see code.

KaibaLopez avatar Sep 16 '20 19:09 KaibaLopez

static void TranscribeSpeechAsyncHandler( const Aws::TranscribeService::TranscribeServiceClient* client, const Aws::TranscribeService::Model::StartTranscriptionJobRequest& request, const Aws::TranscribeService::Model::StartTranscriptionJobOutcome& response, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) { if ( response.IsSuccess() ) { const Aws::TranscribeService::Model::TranscriptionJob& transcription_job = response.GetResult().GetTranscriptionJob(); if ( ( transcription_job.GetTranscriptionJobStatus() == Aws::TranscribeService::Model::TranscriptionJobStatus::QUEUED ) || ( transcription_job.GetTranscriptionJobStatus() == Aws::TranscribeService::Model::TranscriptionJobStatus::IN_PROGRESS ) ) { // wait till transalte finishes // it gets here only once } else if ( transcription_job.GetTranscriptionJobStatus() == Aws::TranscribeService::Model::TranscriptionJobStatus::COMPLETED ) { // report transalte success // it never gets here } else if ( transcription_job.GetTranscriptionJobStatus() == Aws::TranscribeService::Model::TranscriptionJobStatus::FAILED ) { // report transalte failure // it never gets here } } else { // report aws error } }

//.. AWS SDK and transcribe client(server_) initialization Aws::TranscribeService::Model::StartTranscriptionJobRequest request;

std::string input_filename("uri to your audio file on s3"); Aws::TranscribeService::Model::Media input_media; input_media.SetMediaFileUri(input_filename.c_str()); request.WithMedia(input_media);

std::string output_bucket("your bucket on s3"); request.WithOutputBucketName(output_bucket.c_str());

server_->StartTranscriptionJobAsync(request, TranscribeSpeechAsyncHandler);

// .. wait untill the callback completes with success or failure

bsbontchev avatar Sep 16 '20 19:09 bsbontchev

awssdk.zip This is a working example to reproduce the issue. Unzip Run "make clean; make" Run "build/test "your_aws_key_id" "your_aws_key" "s3://yourbucket/yourfile.wav" "yourbucket""

The output will be: arg_initialize() result: 1 sdk_initialize() transcribe_initiailaize() result: 1 request_initiailaize() result: 1 transcription job status: IN_PROGRESS

Any time frame to acknowledge and fix the defect?

bsbontchev avatar Oct 14 '20 14:10 bsbontchev

Tested the latest AWS SDK for C++ with Version:1.8.128, curl 7.68.0, OpenSSL 1.1.1f on Ubuntu. The transcribe issue, e.g. only IN-PROGRESS and no COMPLETE event is still present. aws_sdk_2021-01-22-19.log

bsbontchev avatar Jan 25 '21 14:01 bsbontchev

The transcribe example has been updated and should now work. Please check it out here: https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/transcribe

jmklix avatar Aug 03 '23 23:08 jmklix

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Aug 03 '23 23:08 github-actions[bot]