Visitar URL original
speech file can't be longer than 30 seconds · Issue #3 · realpython/python-speech-recognition · GitHub
Skip to content

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

Description

@jzoudavy

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.

Activity

  1. somacdivad commented on May 15, 2018

    @somacdivad
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions