1

I am able to use AWS S3 service through the AWS CLI like so:

aws s3 cp FileToUpload.txt s3://MyBucketName/file.txt

How can I make use of AWS transcribe service? Looking through google takes me to:

https://docs.aws.amazon.com/cli/latest/reference/transcribe/index.html

But I find no examples on how to use AWS Transcribe using the CLI. I am looking for something like:

aws transcribe createJob s3://MyBucketName/audioToTranscribe.mp3

This does not work but I am assuming there should exists something similar.

I was able to find an example on how to use aws transcribe through c# and it is like this:

MediaFormat mediaFormat;

if (s3BucketNameFollowedByFullPathToAudio.EndsWith(".mp3"))
{
    mediaFormat = MediaFormat.Mp3;
}
else if (s3BucketNameFollowedByFullPathToAudio.EndsWith(".wav"))
{
    mediaFormat = MediaFormat.Wav;
}
else
{

    throw new Exception();
}

var test = transcribeClient.StartTranscriptionJob(new StartTranscriptionJobRequest()
{
    LanguageCode = LanguageCode.EnUS,
    TranscriptionJobName = jobId,
    Media = new Media()
    {


        MediaFileUri = "https://s3.us-east-2.amazonaws.com/" + s3BucketNameFollowedByFullPathToAudio

    },
    MediaFormat = mediaFormat, // MediaFormat.Wav,
});

How can I do this through the aws CLI ?

4

1 回答 1

2

来自AWS Transcribe start-transcription-job— AWS CLI 命令参考

  start-transcription-job
--transcription-job-name <value>
--language-code <value>
[--media-sample-rate-hertz <value>]
--media-format <value>
--media <value>
[--output-bucket-name <value>]
[--settings <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

可在以下位置获得演练:入门(AWS 命令​​行界面)- Amazon Transcribe

于 2018-08-29T00:00:33.500 回答