{
"config": {
"encoding":"FLAC",
"sample_rate": 16000,
"language_code": "en-US"
},
"audio": {
"uri":"gs://speechtotextapi/audio_file.flac"
}
}
curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \ "https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}"
Initially I converted the mp4 file to FLAC format and then uploaded it to the bucket. This is the api response.
{ "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name \"sample_rate\" at 'config': Cannot find field.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "field": "config", "description": "Invalid JSON payload received. Unknown name \"sample_rate\" at 'config': Cannot find field." } ]