简体   繁体   中英

Unable to use GCP signed URL with Azure Cognitive Speech to text

I have uploaded an audio file on GCS bucket and then I created a signed URL for the file using this method:

storage.signUrl(
                blobInfo,
                DURATION,
                TimeUnit.DAYS,
                Storage.SignUrlOption.httpMethod(HttpMethod.GET),
                Storage.SignUrlOption.withContentType()
        );

When I pass this URL to Azure cognitive Speech to text service using the batch transcription REST API this is the request body of azure's create transcription API

{
  "contentUrls": [
    "gcpsignedurl"
  ],
  "properties": {
    "diarizationEnabled": false,
    "wordLevelTimestampsEnabled": false,
    "punctuationMode": "DictatedAndAutomatic",
    "profanityFilterMode": "Masked"
  },
  "locale": "en-US",
  "displayName": "Transcription using default model for en-US"
}

the transcription job gets created and I get the location URL of transcription from the header, now when I Am calling the location URL I get this error

    "error": {
      "code": "InvalidUri",
      "message": "Authentication failed for recordings URI."
    }
    "status": "Failed"

how do I solve this problem?

I think you are using Speech to Text API V3.0 - Batch transcription, it can read audio from a public-visible internet URI , and can read audio or write transcriptions using a SAS URI with Azure Blob storage. You need to make sure your GCP url is public and can be read without any authentication.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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