https://cloud.google.com/text-to-speech/docs/libraries?hl=pt-br#client-libraries-install-python
在尝试Google的主要示例时,我遇到了以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-92-866a7868dbb4> in <module>
10
11 # Set the text input to be synthesized
---> 12 synthesis_input = texttospeech.SynthesisInput(text="Hello, World!")
13
14 # Build the voice request, select the language code ("en-US") and the ssml
AttributeError: module 'google.cloud.texttospeech' has no attribute 'SynthesisInput'
有什么建议吗? 使用conda forge:google cloud texttospeech 1.0.1
我使用相同的库(googlecloudtexttospeech==1.0.1)尝试了您的示例,但也失败了。解决方法是只需使用
!pip install upgrade google-cloud-texttospeech
将库更新到最新版本(2.3.0),代码片段就可以了使用过时的1.0.1版本时出错
出于测试目的,我包括打印编码响应。
相关问题 更多 >
编程相关推荐