我正在从Qwiklabs学习Google Cloud Speech API。(链接到Qwiklabs Google Cloud Speech API:https://google.qwiklabs.com/focuses/588?parent=catalog)
我不知道下面的命令在Google Cloud Shell中的作用。
curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}"
有人解释命令的每个部分以及命令的使用。
curl,-s,-x,-h,post,-数据二进制,内容类型被清楚地说明。
在这种情况下,您正在与Cloud Speech API进行交互,向语音识别端点(POST / v1 / speech:recognize https://cloud.google.com/speech-to-text/docs/reference/rest/v1/speech/recognize)发出POST HTTP请求(curl -s -X POST),并设置内容类型( -H)在Header中向application / json请求,并使用配置和要识别的音频设置json主体(--data-binary)。