GeezerVison is showing github.com — Error: Audio 'content' cannot be longer than 1 min. For long audio, use the 'uri' parameter to specify a file. · Issue #232 · GoogleCloudPlatform/nodejs-docs-samples
Error: Audio 'content' cannot be longer than 1 min. For long audio, use the 'uri' parameter to specify a file. #232Labels 🚨This issue needs some love.triage meI really want to be triaged. DescriptionI get this error for audio samples longer than 60seconds:
Error: Audio 'content' cannot be longer than 1 min. For long audio, use the 'uri' parameter to specify a file.
How to specify the uri parameter in the node cli? Activityjmdobry commented on Oct 11, 2016 You basically need to tell it to use a file you've uploaded to Google Cloud Storage.
node recognize.js sync gs://your-bucket-name/your-file-name
or
node recognize.js async gs://your-bucket-name/your-file-name
Keep in mind the sample assumes LINEAR16 encoding and a sampleRate of 16000. You need to modify those options if your file differs. loretoparisi commented on Oct 12, 2016 @jmdobry I have tried as you said and the call seems to reply with the same error
$ node recognize.js async "https://..."
{ Error: Audio 'content' cannot be longer than 1 min. For long audio, use the 'uri' parameter to specify a file.
at /Volumes/MacHDD2/Projects/MusiXmatch/AI/nodejs-docs-samples/speech/node_modules/grpc/src/node/src/client.js:417:17 code: 400, metadata: Metadata { _internal_repr: {} } }
/Volumes/MacHDD2/Projects/MusiXmatch/AI/nodejs-docs-samples/utils/index.js:44
throw err;
^
Error: Audio 'content' cannot be longer than 1 min. For long audio, use the 'uri' parameter to specify a file.
at /Volumes/MacHDD2/Projects/nodejs-docs-samples/speech/node_modules/grpc/src/node/src/client.js:417:17
So I have tried in this way using my CDN and a WAVE file 16K
$ cat syn-request.json
{
"config": {
"encoding": "WAVE",
"sampleRate": 16000,
"languageCode": "en-US"
},
"audio": {
"uri": "https: //..."
and
$ export GCLOUD_PROJECT=my-project-id
$ gcloud beta auth application-default login
$ GCLOUD_ACCESSTOKEN=`echo gcloud auth print-access-token`
to have an access token and then
$ curl -s -k -H "Content-Type: application/json" -H "Authorization: Bearer $GCLOUD_ACCESSTOKEN" https://speech.googleapis.com/v1beta1/speech:syncrecognize -d @sync-request.json
but I get
{
"error": {
"code": 403,
"message": "Google Cloud Speech API has not been used in project google.com:cloudsdktool before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/speech.googleapis.com/overview?project=google.com:cloudsdktool then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developers console API activation",
"url": "https://console.developers.google.com/apis/api/speech.googleapis.com/overview?project=google.com:cloudsdktool"
}
]
}
]
}
}
This error seems to be the same as referred in googleapis/google-cloud-ruby#706 jmdobry commented on Oct 12, 2016 uri only works with Google Cloud Storage URIs, e.g. gs://your-bucket-name/your-file-name.
If you use https://yourcdn.com/your-file-name then the library is actually downloading the file and passing it to the Speech API as content, not as a uri.
See the docs for Speech#recognize loretoparisi commented on Oct 12, 2016 @jmdobry Just to be clear, this means that passing a generic cdn uri will be limited to 1MB then? jmdobry commented on Oct 13, 2016 loretoparisi commented on Oct 13, 2016 @jmdobry yes sorry 1 minutes of pcm audio. jmdobry commented on Nov 7, 2016 Reacted by narendeveloper1
MetadataMetadata🚨This issue needs some love.triage meI really want to be triaged. DevelopmentNo branches or pull requestsIssue actions
|