2017-01-08 20 views
4

首先,我真的不知道我在做什麼,所以我對愚蠢的問題道歉......只是想在這裏按照指示: https://www.microsoft.com/cognitive-services/en-us/Speech-api/documentation/GetStarted/GetStarted-cURL使用Bing語音例如,捲曲

使用捲曲在Windows上輸入:

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'Authorization:Bearer JWT'-H'Content-type:audio/wav;編解碼器= 「音頻/ PCM」;採樣率= 16000' --data二進制@ 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. 

提前感謝!

回答

2

如果您正確格式化命令行,它應該工作。

您錯過了-H 'Content-type...之前的空間,因此-H前的報價沒有正確處理。您還需要在Bearer之後正確替換您在前一步中收到的令牌,而不僅僅是將JWT

+0

感謝您的回答。是的,JWT只是一個佔位符。插入了正確的標記。 -H之前有一個空格。 MIght在上面的帖子中沒有經過,但是隻是在命令行中檢查過它。 – AnarchyJim

+0

提供確切的文字和截圖,看起來你的編輯不一致。 –