简体   繁体   English

Amazon TranscribeService 的网址

[英]Url for Amazon TranscribeService

I looked the answer ( URL for public Amazon S3 bucket ) but didn't help.我查看了答案( 公共 Amazon S3 存储桶的 URL )但没有帮助。 In my aws I have created bucket programmatically and conformed it exist and created Transcribe object and the output is correct.在我的 aws 中,我以编程方式创建了存储桶并确认它存在并创建了 Transcribe 对象并且输出是正确的。 My objective is to create everything programmatically.我的目标是以编程方式创建一切。 My mediaFileUri is “https://s3.us-west-2.amazonaws.com/willimbarrsbucket/WillimBarrs.mp4”我的 mediaFileUri 是“https://s3.us-west-2.amazonaws.com/willimbarrsbucket/WillimBarrs.mp4”

using (AmazonTranscribeServiceClient transcribeServiceClient = new 
AmazonTranscribeServiceClient(Amazon.RegionEndpoint.USWest2))
{
    StartTranscriptionJobRequest requestJob = new StartTranscriptionJobRequest()
    {
         TranscriptionJobName = "willimbarrsjob",
         LanguageCode = "en-US",

         Media = new Media()
         {
              MediaFileUri = mediaFileUri
         },
         OutputBucketName = "willimbarrsbucket"
 };

            var responce = await transcribeServiceClient.StartTranscriptionJobAsync(requestJob);

I get an error “The URI that you provided doesn't point to an S3 object.我收到错误消息“您提供的 URI 未指向 S3 对象。 Make sure that the object exists and try your request again”确保该对象存在并再次尝试您的请求”

I am not sure what I am doing wrong?我不确定我做错了什么? I am using the code from https://net-immersionday.workshop.aws/4-adding-innovation-ai-ml/transcribe.html Any help will be very much appreciated.我正在使用https://net-immersionday.workshop.aws/4-adding-innovation-ai-ml/transcribe.html 中的代码,非常感谢任何帮助。

FromMedia - Amazon Transcribe :来自媒体 - 亚马逊转录

MediaFileUri媒体文件Uri

The S3 object location of the input media file.输入媒体文件的 S3 对象位置。 The URI must be in the same region as the API endpoint that you are calling. URI 必须与您正在调用的 API 端点位于同一区域。 The general form is:一般形式为:

s3://<AWSDOC-EXAMPLE-BUCKET>/<keyprefix>/<objectkey>

Therefore, you should use:因此,您应该使用:

s3://willimbarrsbucket/WillimBarrs.mp4

When you upload a file, there is a key associated with that file.当您上传文件时,有一个与该文件关联的密钥。 use that key string mediaFileUri = $"s3-us-west-2.amazonaws.com{bucketName}/{Key}";使用该密钥字符串 mediaFileUri = $"s3-us-west-2.amazonaws.com{bucketName}/{Key}"; Now it works.现在它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM