private String getTranscriptText(String fileNameS3)
            throws AwsServiceException, SdkClientException, IOException {
        TranscriptionJob transcriptionJob = retrieveObjectWhenJobCompleted(fileNameS3);
        String text = "";
        if (transcriptionJob != null && !TranscriptionJobStatus.FAILED
                .equals(transcriptionJob.transcriptionJobStatus())) {
            ResponseInputStream<GetObjectResponse> s3Object = amazonS3.getObject(GetObjectRequest.builder().bucket(bucketName).key(fileNameS3 + ".json")
                    .build());
            try (s3Object) {
                ObjectMapper mapper = new ObjectMapper();
                JsonNode root = mapper.readTree(s3Object);
                text = root
                        .path("results")
                        .path("transcripts")
                        .get(0)
                        .path("transcript")
                        .asText();
                // could also be done with json.simple:
                // ((JSONObject)((JSONArray)((JSONObject) obj.get("results")).get("transcripts")).get(0)).get("transcript")
            }
        }
        return text;
    }
Gets Transcription result from AWS S3 bucket given the jobName.

@param fileNameS3 The path of the file to upload to Amazon S3.
@return The transcribed string result, NULL if the job failed.
@throws IOException            possible reasons include (i) an End Event is not received
                               from AWS S3 SelectObjectContentResult operation and (ii) a parse exception
                               whilst processing JSON from the AWS S3 SelectObjectContentResult operation.
@throws SdkClientException     a AWS-specific exception related to SelectObjectContentResult
                               operation.
@throws AwsServiceException possibly thrown if there is an issue selecting object content
                               from AWS S3 objects.
tika-parsers/tika-parsers-ml/tika-transcribe-aws/src/main/java/org/apache/tika/parser/transcribe/aws/AmazonTranscribe.java