I'd like to be able to make a speech:recognize request on and with my own cloud-hosted resources, so I can simply log into the Google Cloud Platform console, run a command in the Cloud Shell, and see the results. Much like https://cloud.google.com/speech-to-text/docs/quickstart-protocol, except without making use of anything locally.
Not sure what other important info to share, but the .json and .flac files in my cloud have public read access.
How can I achieve this?
my request:
curl -H "Content-Type: application/json" https://speech.googleapis.com/v1/speech:recognize?key=[my-api-key] -d @https://storage.googleapis.com/[bucket]/[json-request-filename].json
the response:
Warning: Couldn't read data from file
Warning: "https://storage.googleapis.com/[bucket]/[json-request-filename].json",
Warning: this makes an empty POST.
{
"error": {
"code": 400,
"message": "RecognitionAudio not set.",
"status": "INVALID_ARGUMENT"
}
}
here's the .json hosted in google cloud storage:
{
"config": {
"encoding":"FLAC",
"sampleRateHertz": 16000,
"languageCode": "en-US",
"enableWordTimeOffsets": false
},
"audio": {
"uri":"gs://[bucket]/[audio-filename].flac"
}
}
No new info, but here's how it all looks the Google Cloud Platform Shell:
[my-account]@cloudshell:~ ([my-project])$ curl -H "Content-Type: application/json" https://speech.googleapis.com/v1/speech:recognize?key=[my-api-key] -d @https://storage.googleapis.com/[bucket]/[json-request-filename].json
Warning: Couldn't read data from file
Warning: "https://storage.googleapis.com/[bucket]/[json-request-filename].json",
Warning: this makes an empty POST.
{
"error": {
"code": 400,
"message": "RecognitionAudio not set.",
"status": "INVALID_ARGUMENT"
}
}