I hava a AWS Lambda function written in Java. This function starts a TranscriptionJob and then wait for the response like so:
while( true ){
transcriptionJob = awsClient.getTranscriptionJob(getJobRequest).getTranscriptionJob();
if( transcriptionJob.getTranscriptionJobStatus().equals(TranscriptionJobStatus.COMPLETED.name()) ){
System.out.println("AWS transcribe completed with " + transcriptionJob.getMedia().getMediaFileUri());
Date comleption = transcriptionJob.getCompletionTime();
// duration until response in seconds
long duration = (comleption.getTime()-awsTranscribeStart.getTime())/1000;
logger.log("AWS transcribe took " + duration + " seconds\n");
break;
}else if( transcriptionJob.getTranscriptionJobStatus().equals(TranscriptionJobStatus.FAILED.name()) ){
System.out.println("AWS transcribe failed: " + transcriptionJob.getFailureReason());
break;
}
System.out.println("Waiting for response...");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
For my longer audio files, a transcription job takes up to 10 minutes to be completed but a Lambda function is limited to 5 minutes. There is no "Transcription job completed event" or something similiar(yet).
Is there a workaround for this problem or do I have to switch from AWS Lambda to something else?