【发布时间】:2019-03-22 05:47:17
【问题描述】:
我尝试遵循以下建议:
Google Cloud Text To Speech API Quickstart example
Google Cloud Text-to-Speech Interface Confusion (How do I download the mp3 files?)
https://cloud.google.com/text-to-speech/docs/quickstart-client-libraries
但即使有所有这些信息,我也无法让它工作。 关于分步指南,我被困在:
“然后你可以像这样使用 curl 命令”或“3)他们提供了一个通用文件的示例请求:”
代码在哪里输入? Powershell 只给我错误,不幸的是这些错误是德语,所以我尝试翻译它们。我不认为它打算在那里使用代码,因为我除了复制并粘贴带有我的凭据的行之外什么也没做。
这是有问题的错误,当我将链接 #2 的代码(步骤 3)粘贴到 Powershell 中时:
In line: 3 characters: 5
+ --data "{
+ ~
Expression is missing after the unary operator "-".
In line: 3 characters: 5
+ --data "{
+ ~~~~
Unexpected token "data" in expression or statement.
In line: 3 characters: 9
+ --data "{
+ ~
In the section "Data" the associated statement block is missing.
In line: 17 characters: 6
+} "" https://texttospeech.googleapis.com/v1/text:synthesize "> synth ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~
Unexpected Token "" https://texttospeech.googleapis.com/v1/text:synthesize "" in expression or statement.
+ CategoryInfo: ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId: MissingExpressionAfterOperator
【问题讨论】:
-
我可以在 Windows 环境中重现相同的错误,我认为这里的问题是您如何指定 cUrl。正如我所看到的,PS 中的命令应该是不同的,正如some other questions 所解释的那样。但是,我对 PS 不熟悉,您可以对此做进一步的研究。
标签: python curl google-cloud-platform gcloud google-text-to-speech