【问题标题】:Using Bing Speech example with Curl使用带有 Curl 的 Bing 语音示例
【发布时间】:2017-05-23 04:27:14
【问题描述】:

首先,我真的不知道自己在做什么,所以我为这个愚蠢的问题道歉......只是尝试按照这里的说明进行操作: https://www.microsoft.com/cognitive-services/en-us/Speech-api/documentation/GetStarted/GetStarted-cURL

在 Windows 上使用 cURL 并输入:

curl -v -X POST "https://speech.platform.bing.com/recognize?scenarios=ulm&appid=D4D52672-91D7-4C74-8AD8-42B1D98141A5&locale=en-US&device.os=windows&version=3.0&format=json&instanceid=e8ef8f76-2318-45d4-ac04-b73362ac61ec&requestid=73346a62-51fb-4aad-882b-9e5cd4198f57" -H '授权:承载JWT'-H '内容类型:audio/wav;编解码器="音频/pcm";采样率=16000' --data-binary @bing2.wav

这是输出...关于我做错了什么的任何线索将不胜感激:

*  SSL certificate verify ok.
> POST /recognize?scenarios=ulm&appid=D4D52672-91D7-4C74-8AD8-
42B1D98141A5&local
e=en-US&device.os=windows&version=3.0&format=json&instanceid=e8ef8f76-2318-    45d4-
ac04-b73362ac61ec&requestid=73346a62-51fb-4aad-882b-9e5cd4198f57 HTTP/1.1
> Host: speech.platform.bing.com
> User-Agent: curl/7.50.0
> Accept: */*
> Content-Length: 314438
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 403 Forbidden
< Content-Length: 0
< Server: Microsoft-IIS/8.5
< X-MSEdge-Ref: Ref A: 3BA3FD7E454246D69D3B1E6C436F0261 Ref B:     
8CD198CC061DC0914
B02FDF95CFEDBD6 Ref C: Sun Jan  8 15:06:41 2017 PST
< Date: Sun, 08 Jan 2017 23:06:41 GMT
<
* Connection #0 to host speech.platform.bing.com left intact
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: Bearer/
* Could not resolve host: Bearer
* Closing connection 1
curl: (6) Could not resolve host: Bearer
Note: Unnecessary use of -X or --request, POST is already inferred.

提前致谢!

【问题讨论】:

    标签: curl speech-to-text bing-api


    【解决方案1】:

    如果您正确格式化命令行,它应该可以工作。

    您错过了-H 'Content-type... 之前的空格,因此-H 之前的引用没有被正确处理。您还需要在Bearer 之后正确替换您在上一步中收到的令牌,而不仅仅是放入JWT

    【讨论】:

    • 感谢您的回答。是的,JWT 只是一个占位符。插入了正确的令牌。 -H 之前有一个空格。在上面的帖子中可能没有通过,但只是检查了一下,它就在命令行上。
    • 然后提供确切的文字和屏幕截图,您的编辑似乎不一致。
    猜你喜欢
    • 2018-02-05
    • 2018-08-30
    • 2016-06-14
    • 1970-01-01
    • 2012-09-29
    • 2017-10-29
    • 2023-03-16
    • 2015-07-31
    • 1970-01-01
    相关资源
    最近更新 更多