gs协议是什么意思?

What does gs protocol mean?

我在玩Google Speech Recognition API

成功 Getting started 之后,我试图理解第一个示例并对其进行了一些更改,但我不知道 "gs" 协议是什么以及如何将其设置为使用我自己的音频文件。

同步-request.json

{
  "config": {
      "encoding":"FLAC",
      "sample_rate": 16000
  },
  "audio": {
      "uri":"gs://cloud-samples-tests/speech/brooklyn.flac"
  }
}

我尝试将 gs 协议更改为 http 协议但不起作用。

提前致谢。

gs:// 方案用于标识存储在 Google Cloud Storage.

中的资源

您可以通过以下方式访问您提到的文件:

https://storage.googleapis.com/cloud-samples-tests/speech/brooklyn.flac

因此,如果您 create/upload 自己的文件在 Google 存储中——就像我现在正在测试的 API 您正在使用的一样——"equivalence" 如下

https://storage.googleapis.com/ 

转换为

gs://

反之亦然

我不知道为什么Google没有解释清楚。

希望对您有所帮助。

Google 的 API 文档是这样说的:

https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#audioencoding

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: gs://bucket_name/object_name (other URI formats return google.rpc.Code.INVALID_ARGUMENT).