@Override
    public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
                      ParseContext context) throws IOException, SAXException, TikaException {

        if (!isAvailable) {
            return;
        }
        // isAvailable does not check this
        if (amazonS3 == null) {
            return;
        }
        String jobName = getJobKey();
        LanguageCode languageCode = context.get(LanguageCode.class);
        uploadFileToBucket(stream, jobName);
        StartTranscriptionJobRequest startTranscriptionJobRequest =
                StartTranscriptionJobRequest.builder()
                        .build();
        Media media = Media.builder().mediaFileUri(amazonS3.utilities().getUrl(GetUrlRequest.builder().bucket(bucketName).key(jobName).build()).toString()).build();
        startTranscriptionJobRequest = startTranscriptionJobRequest.toBuilder().media(media).outputBucketName(bucketName)
                .transcriptionJobName(jobName).build();

        if (languageCode != null) {
            startTranscriptionJobRequest = startTranscriptionJobRequest.toBuilder().languageCode(languageCode).build();
        } else {
            startTranscriptionJobRequest = startTranscriptionJobRequest.toBuilder().identifyLanguage(true).build();
        }
        amazonTranscribeAsync.startTranscriptionJob(startTranscriptionJobRequest);
        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
        String text = getTranscriptText(jobName);
        xhtml.startElement("p");
        xhtml.characters(text);
        xhtml.endElement("p");
        xhtml.endDocument();

        deleteFilesFromBucket(jobName);
    }
Starts AWS Transcribe Job with language specification.

@param stream   the source input stream.
@param handler  handler to use
@param metadata
@param context  -- set the {@link LanguageCode} in the ParseContext if known
@throws TikaException When there is an error transcribing.
@throws IOException   If an I/O exception of some sort has occurred.
@see <a href=
"https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/transcribe/model/LanguageCode.html">AWS
Language Code</a>
tika-parsers/tika-parsers-ml/tika-transcribe-aws/src/main/java/org/apache/tika/parser/transcribe/aws/AmazonTranscribe.java