speech_recognition icon indicating copy to clipboard operation
speech_recognition copied to clipboard

API Key for recognize_google()

Open theyash14 opened this issue 1 year ago • 2 comments

This is not a issue, rather I want to share my findings

Since I can see a lot of issues getting created around recognize_google(), I thought I will share my findings.

First steps, how do you get an API key of your own for recognize_google()

  1. Follow steps in Chromium dev.
  2. First get yourself a google cloud console account and create a project.
  3. With the same email, join the Chromium dev group. You can select "No email" if you want.
  4. In the left menu, go to API & Services -> Library.
  5. Search "Speech API", you can see it is a private API. Meaning, you can access this only if you join Chromium dev group.

Screenshot from 2024-09-08 17-21-42

  1. Enable the API and go to credentials page in the same API & Services.
  2. Click on create credentials and select API Key, a key will be generated (restrict this API key to Speech API only if you want).

And there you have it, your own API key that you can use with recognize_google()

Few thoughts on Speech API

It doesn't look like the Speech API incurs cost, and is advisable to use only for development/testing purposes. So, please don't use this for production as it is in the control of Google. Although in my testing, accuracy of Speech API > Cloud Speech API (for Japanese languge).

Final Thoughts

I know, this is too much information. Please ask, if you are stuck anywhere. Also please don't forget to gitignore your .env file before pushing. If you didn't then no worries, Our API Key 🤝.

theyash14 avatar Sep 08 '24 12:09 theyash14

Do you think it's more accurate?

TomKranenburg avatar Oct 24 '24 15:10 TomKranenburg

Do you think it's more accurate?

In my testing, STT in japanese language was more accurate in this API than cloud speech API. But can't say for sure, might require more testing.

theyash14 avatar Nov 03 '24 22:11 theyash14