因此,当我尝试使用Google语音文字时,我卡住了。我基本上遵循此代码。我正在使用树莓派将flac文件发送到Google云。
#!/bin/bash
# parameter 1 : file name, contains flac encoded voice recording
echo Sending FLAC encoded Sound File to Google:
key=''
url='https://www.google.com/speech-api/v2/recognize?output=json&lang=en-us&key='$key
curl -i -X POST -H "Content-Type: audio/x-flac; rate=16000" --data-binary @$1 $url
echo '..all done'
但是我一直得到这个结果
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console",
"url": "https://console.developers.google.com"
}
]
}
]
} } ..全部完成
任何人都可以帮助解决什么问题?