Git Product home page Git Product logo

Comments (6)

NatGr avatar NatGr commented on June 2, 2024

Hello,
I was using google-cloud-speech version 1.3.2, it appears they are at version 2.10 now and they made some breaking changes https://googleapis.dev/python/speech/latest/UPGRADING.html.

If you are using v2, could you please try replacing

response = client.recognize(config, audio)
(line 31)
by
request = speech_v1.RecognizeRequest(request={"config": config, "audio": audio}) response = client.list_voices(request=request)

you might also need to replace speech_v1 by speech in the file, (latest versions of the doc don't refer to speech_v1 anymore but you got an error at line 31 so perhaps it still works).

I lost the audio files I used with that project so I would appreciate to know if doing so worked for you so I can update the repo afterwards.

from annotate_audio.

CaptInfinity avatar CaptInfinity commented on June 2, 2024

Good news is that pip install google-cloud-speech==1.3.2 still works and the package runs great!! I was able to produce annotated results and review them with step 3. Love it!!

Bad news, I attempted to the google migration guidance and still have an issue:
`Traceback (most recent call last):
File "/opt/anaconda3/envs/tf3/lib/python3.6/site-packages/proto/message.py", line 505, in init
pb_type = self._meta.fields[key].pb_type
KeyError: 'request'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "get_gcp_transcription.py", line 31, in
request = speech.RecognizeRequest(request={"config": config, "audio": audio})
File "/opt/anaconda3/envs/tf3/lib/python3.6/site-packages/proto/message.py", line 511, in init
"Unknown field for {}: {}".format(self.class.name, key)
ValueError: Unknown field for RecognizeRequest: request`

from annotate_audio.

NatGr avatar NatGr commented on June 2, 2024

I'm glad it works!

maybe config should be a specific object and not a json anymore with version 2.10
https://googleapis.dev/python/speech/latest/speech_v1/types.html#google.cloud.speech_v1.types.RecognitionConfig

I'll try to find a sample and make it work with version 2.10 tomorrow

from annotate_audio.

NatGr avatar NatGr commented on June 2, 2024

just updated the repo, this should work with version 2.X as well now

from annotate_audio.

CaptInfinity avatar CaptInfinity commented on June 2, 2024

Worked perfectly! Only 2 nit-picks on your merge:

  1. the requirements.txt file is now 'requirement.txt' and needs to be updated in Readme
  2. the link on configuring the google auth should probably be this link:https://cloud.google.com/docs/authentication/getting-started

Looks great! thanks so much for merging in the change to support the latest google API! you rock!

from annotate_audio.

NatGr avatar NatGr commented on June 2, 2024

Indeed you are right, I'll update that.
Thanks for the feedback and kind words ^^

from annotate_audio.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.