0

I've made a Lambda Function, using boto3, that is triggered when I upload an audio file to my s3 bucket. The function creates a transcription job using boto3's "start_transcription_job" method. I don't specify an OutputBucketName value, meaning my transcript is placed in a service-managed Amazon S3 bucket and I'm provided with a URI to access my transcript.

I then want to use the "get_transcription_job" method to obtain the output of the transcribed file. The "get_transcription_jobs" response syntax provides a 'Transcript' key with a 'TranscriptFileUri' value, but I'm not too sure how to obtain that value, or the transcribed text.

I hope this makes sense, there are a lot of parts in this Lambda Function and I'm confusing myself trying to explain it.

  • What does the `TranscriptFileUri` look like? Is it a regular URL or a pre-signed S3 URL? If so, just fetch/get it using any standard HTTP client such as wget/curl, Python requests etc. – jarmod Mar 31 '23 at 15:59
  • You have 15 minutes after making a call to `get_transcription_job` to download the data from the URL in `results["TranscriptionJob"]["Transcript"]["TranscriptFileUri"]`. You can use any library you'd like, such as `urllib.requests.urlopen()` with this URL to retrieve the data. – Anon Coward Mar 31 '23 at 16:20
  • @jarmod That's what I'm not sure of, I've never actually laid eyes upon this TranscriptFileUri before. Uris and Urls are different right? – BlueAcid98 Mar 31 '23 at 20:18
  • @AnonCoward Apologies for what might be a dumb question, but are Uris and Urls the same? I think my issue is I don't know what to place inside that 'urllib.requests.urlopen()' method. I'm not sure how to obtain the URL – BlueAcid98 Mar 31 '23 at 20:20
  • Print/log the value to find out. URLs are URIs (but not vice-versa [afaik](https://stackoverflow.com/questions/176264/what-is-the-difference-between-a-uri-a-url-and-a-urn)). You should be able to pass it as the url parameter to `urllib.requests.urlopen()`, assuming that's your preferred HTTP client. – jarmod Mar 31 '23 at 21:01
  • A URL is a type of URI. The field allows both `s3://bucket/whatever` style URIs if you specify a bucket and key to output to, or `https://whatever` type URLs if you ask AWS to manage the storage for you – Anon Coward Mar 31 '23 at 21:16

0 Answers0