2017-04-21 83 views
2

感謝您打開此頁面。Watson Speech to Text:如何在Windows上設置我的用戶名和密碼10

我想將講座會議的音頻文件轉錄爲文本,並使用Speech to Text和curl文本。

也許我有一個基本錯誤。 我閱讀官方Bluemix文檔,但我無法理解它們。

我已經拿到了我的服務憑證。 但我無法設置它們。

我試着像這樣設置它們。

上Bluemix一個例子公文>>

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" 

試過1 >>

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" 

試過2 >>

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" 

此代碼下面的錯誤,而不是工作。

警告:無法從文件中讀取數據 「{}路徑音頻file.flac」警告:這使得空 POST。捲曲:(60)SSL證書的問題:自簽名的證書 鏈的更多細節證書這裏: http://curl.haxx.se/docs/sslcerts.html

而且我不知道我應該把我的音頻文件,並從那裏我應該路徑文件。 我從終端的pwd到他們的路徑,我把它們放在我的本地目錄。這是錯的嗎?

你能給我你的建議嗎?

回答

0

你需要把你的音頻文件的絕對路徑。

例如(如果該文件是在我的當前目錄):

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

+1

非常感謝您!現在它運作良好。 –