ImportError: cannot import name 'enums'

后端 未结 2 1656
遥遥无期
遥遥无期 2021-01-24 02:14

I am trying to use Google Speech API to recognize speech from mic input in real time. I have tried https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/s

相关标签:
2条回答
  • 2021-01-24 02:38

    I am using cloud function to transcribe the audio to text. I believe the documentation for google-cloud-speech has been updated, you may refer to the documentation. https://pypi.org/project/google-cloud-speech/. I believe the class is now called speech_v1, you can use the alias "as speech" to make the github sample codes work.

    from google.cloud import speech_v1 as speech
    from google.cloud.speech_v1 import enums
    from google.cloud.speech_v1 import types
    

    HTH.

    0 讨论(0)
  • 2021-01-24 02:44

    I got mine working with the following import

    from google.cloud.speech_v1.gapic import enums
    
    0 讨论(0)
提交回复
热议问题