Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does gs protocol mean?

I'm playing with Google Speech Recognition API

After a successfully Getting started I'm trying to understand and made some changes in this first example but I don't know what "gs" protocol is and how to set it to use my own audio file.

sync-request.json

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

I tried to change gs protocol to http protocol but doesn't work.

Thanks in advance.

like image 323
Salvador Rueda Avatar asked Aug 06 '16 16:08

Salvador Rueda


3 Answers

You can access the file that you mention as follows:

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

So, if you create/upload your own file in Google Storage -- like I'm doing now while testing the same API you are using-- the "equivalence" is the following:

https://storage.googleapis.com/ 

translates to

gs://

and viceversa.

I have no idea why Google doesn't explain this clearly.

I hope this helps.

like image 163
Hugo Nava Kopp Avatar answered Oct 20 '22 13:10

Hugo Nava Kopp


gs:// scheme is used for identifying resources stored in Google Cloud Storage.

like image 34
Alexey Alexandrov Avatar answered Oct 20 '22 14:10

Alexey Alexandrov


This is what Google's API docs says:

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).

like image 2
Prashant Avatar answered Oct 20 '22 15:10

Prashant