2017-03-23 93 views
3

我下面這個教程建立一個講話IBM Bluemix文本服務: https://www.ibm.com/watson/developercloud/doc/speech-to-text/tutorial.shtml捲曲沒有URL指定

我已經安裝和測試的先決條件,但不知何故,我得到一個錯誤,當我試圖進入:

curl -X POST -u <username>:<password> 
--header "Content-Type: audio/flac" 
--header "Transfer-Encoding: chunked" 
--data-binary @<path>audio-file.flac 
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true" 

我得到了以下錯誤:

curl: no URL specified! 
curl: try 'curl --help' or 'curl --manual' for more information 

我測試過的用戶名和密碼,當我直接訪問網址和它的工作。我爲音頻文件輸入的路徑也是正確的,因爲我只是複製它。

有誰知道如何解決這個問題? 在此先感謝! :)

+0

是否所有內容都作爲單個命令輸入? –

+0

不,我將它粘貼到Cmder中一次 – MaGi

回答

3

您錯過了換行的換行符。嘗試是這樣的:

curl -X POST -u "myusername":"mypassword" \ 
--header "Content-Type: audio/flac" \ 
--data-binary "@audio-file1.flac" \ 
--data-binary "@audio-file2.flac" \ 
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?timestamps=true&word_alternatives_threshold=0.9&keywords=%22colorado%22%2C%22tornado%22%2C%22tornadoes%22&keywords_threshold=0.5&continuous=true" 

Sample Audio Files

+0

Hi @MaGi,這是否解決了您的問題? – joe

+0

對不起,我不知道你已經回答了:P 但它告訴我:「curl:(6)無法解析主機'\'」 – MaGi

+0

您是否使用Windows? – joe

0

好了,我忘了雙引號,當我進入的路徑。但現在它返回這個HTML代碼:

<HTML><HEAD> 
<TITLE>Network Error</TITLE> 
</HEAD> 
<BODY> 
<FONT face="Helvetica"> 
<big><strong></strong></big><BR> 
</FONT> 
<blockquote> 
<TABLE border=0 cellPadding=1 width="80%"> 
<TR><TD> 
<FONT face="Helvetica"> 
<big>Network Error (tcp_error)</big> 
<BR> 
<BR> 
</FONT> 
</TD></TR> 
<TR><TD> 
<FONT face="Helvetica"> 
A communication error occurred: "Connection refused" 
</FONT> 
</TD></TR> 
<TR><TD> 
<FONT face="Helvetica"> 
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. 
</FONT> 
</TD></TR> 
<TR><TD> 
<FONT face="Helvetica" SIZE=2> 
<BR> 
For assistance, contact your network support team.<br><br>Your request was categorized by Blue Coat Web Filter as 'Technology/Internet'. <br>If you wish to question or dispute this result, please click <a href="http://sitereview.bluecoat.com/sitereview.jsp?referrer=136&url=http://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true">here</a>. 
</FONT> 
</TD></TR> 
</TABLE> 
</blockquote> 
</FONT> 
</BODY></HTML> 

在此先感謝!

+0

目前還不清楚您是否有其他問題,因此您可能無法獲得答覆。如果這是一個新問題,那麼最好的辦法就是根據您的新問題發佈一個新問題。 – ralphearle