- Newest
- Most votes
- Most comments
Hi!
According to the documentation https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.start_transcription_job the mediaFormat has to be a string. In Python "OR" is a boolean operator. The result of "mp3" or "mp4" is the value "mp3". This is probably not your intended input for the function.
As the API documentation does not mention a way to specify several format, I suggest creating two different lambda function. One for mp3, the other for mp4.
Best, Matthäus
Hi - Thanks for reaching out. The flag media-format is a string and can take possible values like mp3, mp4, wav, flac. Don't think so it will take something like MediaFormat="mp3" or "mp4".
One possible option is to
- Get the extension from eventRecord
- Check for valid extension type like if (!['mp3', 'mp4', 'wav', 'flac'].includes(extension))
- If valid then create a dynamic Media format like MediaFormat: extension
In this way, you can have a single lambda function that can be re-purposed for the supported extensions
Hope this helps.
Relevant content
- Accepted Answerasked 2 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago