zaf / asterisk-speech-recog

Speech recognition script for Asterisk that uses google's speech engine.
GNU General Public License v2.0
247 stars 133 forks source link

API endpoints appear to be incorrect - not working #30

Closed ghost closed 7 years ago

ghost commented 8 years ago

EDIT: I have found a Google Python client library that seems to work well with pyst and Asterisk 14 and I'll tidy the code up and post something here tomorrow!

Hi there; it looks like this project might be using v2 of the old "unofficial" speech recognition.

But, confusingly, it looks like Google have now officially launched a speech API, but called V1beta.

See https://cloud.google.com/speech/reference/rest/

The endpoints are https://speech.googleapis.com and the methods are /v1beta1/speech:asyncrecognize

For example https://speech.googleapis.com/v1beta1/operations/list?key=xxxxx

Before I start hacking away at stuff I don't really understand, are you aware of this and working on an update? Do these two links help? https://cloud.google.com/speech/docs/rest-tutorial https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/speech

zaf commented 8 years ago

Hello,

yes the script is still using the old Speech API 'https://www.google.com/speech-api/v2/recognize' The end points are not incorrect as pointed out, the API is still functional so is the speech recognition script. I am aware of the new Speech API from Google and as soon as I find some free time there will probably be an update or a new version that will utilize the 'Cloud speech API'.

ghost commented 8 years ago

Oh, OK. I just can't find how to generate an API key for the old endpoints, so they were rejecting it.

Sit back and take a break for a few hours - I've now got a fully functioning python implementation that uses the new Cloud Speech API. I'm doing a bit of code cleanup and a quick tutorial, but I'm not a python programmer so if I post it here, I'd greatly appreciate your help in cleaning it up. :)

zaf commented 8 years ago

The process to get a key for this API is completely obscured by Google. Among other things to get the Speech API option on your API console you have to join the Chromium dev list group https://groups.google.com/a/chromium.org/forum/#!forum/chromium-dev

It was covered in detail in previous discussions, please see issue #9 and issue #10

ghost commented 8 years ago

Oh no! I have just discovered the pull request from @invitecomm in your repo! It is almost exactly the same conclusion I came to at 2am this morning - for anyone else struggling, please see this fork https://github.com/invitecomm/asterisk-speech-recog/tree/master/v1beta1

zaf commented 8 years ago

A new branch (cloud_api) with support for the Cloud Speech API has been added. All AGI and CLI scripts are converted to use the Cloud API.