Thats awesome! Im working along similiar lines, i also installed googlecl to read things and post things from googles command line interface for some of their services which is a bit eaiser than writing a scrapper from scratch whose format could change.

Are you using a usb or jack in mic or bluetooth mic? Im trying to get bluetooth going for voice and playback of audio

I can now connect to server, and get a reponse.I am writing in Python & the original v1 api call returned a perfect response everytime and was saved in stt.txt which I am then passing to another part of the app.

I now get a 200 OK response from google and I am receiving an approx 400b file (which seems tiny to me) back from the v2 api and this is written to SDTOUT.

But - the response that now gets saved to stt.txt is either the single word 'final' or I have twice had the word 'transcript' - and I have no idea why or what this means.

In one attempt with the identical settings, I got a portion of the sentance that I had spoken - every other test has produced the result above.

If anyone has got futher than me - all help is greatfully received. I had a fully working app running on the Pi until last night.

A bit more research has turned up the fact that the JSON being returned by google is in a different format. I suspect this is the root cause of the issue. How this new format can be converted into a text file is however sadly beyond me!

The problem I'm having seems to be a unique error. At this point, for my project, I only want to be able to get to the point of transcribing my speech to text. For the next phase of the project I will run a script that counts the words of a conversation for meetings that we have. (Should be a pretty cool way of quantifying our meetings and doing some interesting comparisons based on who is in the room for different meetings.) For now, though, the problem is this: when I run the script below, I do not get an error. It only says "Processing..." Then, without pressing Control C to stop recording, it immediately jumps to "You said: [email protected] ~$"

I've also tried running different variations of code from the various tutorials available for Google Speech API.
I've searched all over and haven't seen anybody posting about the error that I'm experiencing. Anybody have any idea what's happening here and how I can get my speech to text?

The Google API is returning the translated file but it is in a different format. I'm also looking for an easy way to extract the data so I can translate the file to another language. The only difference from my code and yours posted above is I have v2 where you have vs and at the end I have just >file .txt without the "cut" command. That is the part that was not working with the newer format.

A bit more research has turned up the fact that the JSON being returned by google is in a different format. I suspect this is the root cause of the issue. How this new format can be converted into a text file is however sadly beyond me!

You may want to test your API key by browsing to the "http:..." address in your browser and you should get the following message "400. That’s an error.Your client has issued a malformed or illegal request. Content-Type should be of the form: audio/xxx; rate=yyy That’s all we know." I was initially having issues with my API because it wasn't initialized correctly.

"403. That’s an error.
Your client does not have permission to get URL /speech-api/v2/recognize?lang=en-us&client=chromium&key=AIzaSyCZqgSwomikHVUKSiwdtfoYSgMN7hq9q7g from this server. Invalid key. That’s all we know."

That is what I was getting this weekend before I realized that the lower case l in the key was actually a capital I(eye). That is why I had you look for the 400 error which means your key is good. Also, make sure you have the Speech API enabled. Another way to make sure the API is working is to notice that your usage count increases every time you get a 400 error even though there is no translation.

So it is a capital I(eye) and not a lower case L. I've confirmed that because I can see in my Google dev console that I now have a 7 count for calls to the API. So good eye on that. I hadn't thought of changing that. (Doh!)

Even so, I'm still getting a 403 error. Even though my console is telling me that the API usage is being impacted.
Here's what my console tells me:

Response Code Count %
Success (2xx) 7 100%

Requests / sec
Success (2xx): 0.0167

Is there something in the RPi code you think I could debug to slow down the rate at which it goes from "Recording" to "Processing"?

This is nuts! The api and code is working for you. What am I missing here that I can't get it working on my end? Oi!
Really appreciate your hand in all this.

Holy crap! Gtucker! I think I finally got it to work using your API key.

Right now it's only converting short bursts of speech (~3-5 seconds). And I'm having trouble with my API key (i.e. it's not working). I'm going to try to reset it. But had to post this real quick to share my excitement.

Okay, so I'm not sure what's going on with my API keys. But they're not working.

AIzaSyCqS-vSYEuFZ65_bN1ucB3cNB4322XDWLY

Also turns out that Google Speech API will only translate 15 second clips. (Drats!)

I'd love to know why my APIs aren't working. If anybody has any ideas, let me know. I really need to be able to record for longer than 15 seconds. So I may have to hop over to trying to figure out how to use Sphinx open source speech tools. But this may do for now for my proof of concept. So I'll keep working...