Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speech file can't be longer than 30 seconds #3

Open
jzoudavy opened this issue May 15, 2018 · 1 comment
Open

speech file can't be longer than 30 seconds #3

jzoudavy opened this issue May 15, 2018 · 1 comment

Comments

@jzoudavy
Copy link

hi

i modifed your code a bit to read from sample file. My sample file is 55 seconds long and I noticed that it get's cut off.

I am using recognize_google.

I am guessing this is some sort of api limitation and that I should probably get my own key.

@somacdivad
Copy link
Contributor

somacdivad commented May 15, 2018

@jzoudavy Yes, this is a limitation of the Google Web Speech API. Unfortunately, I don't think you get any additional length by using your own key. For longer files, you have a couple of options:

  1. Break them up into chunks, either manually with audio editing software, or using the offset and duration keyword arguments for the .record() method.
  2. Use the .listen() method to capture speech until a pause is detected. This is not covered in the article. You can find information about this method in the Speech Recognition docs.
  3. Use the Google Cloud Speech API. That is not a free API, although you can get an account with a free $300 credit for one year at https://cloud.google.com. I don't cover setting up an account and obtaining a key for the Google Cloud platform in the article. Here is a quick start on how to do that from the Google Cloud docs: https://cloud.google.com/speech-to-text/docs/quickstart-client-libraries.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants