0
IBM Speech-To-Text에 액세스하기 위해 Python 스크립트를 작성하려고합니다. 나는 자신의 사이트에 예를 컬하는 동등한 명령을 만들려고 :IBM Watson Speech To Python을 사용하여 텍스트 손상된 파이프 요청
curl -X POST -u <username>:<password> --header "Content-Type: audio/flac" --header "Transfer-Encoding: chunked" --data-binary @<path>0001.flac "https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true×tamps=true&max_alternatives=3"
내가 해낸 다음 두 번째가 제공하는 동안
headers = {
'Content-Type': 'audio/flac',
'Transfer-Encoding': 'chunked',
}
auth = (USERNAME, PASSWORD)
data = open(audio_name, 'br')
r = requests.post('https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true×tamps=true&max_alternatives=3'
, headers=headers, data=data, auth=auth)
첫 번째 명령은 터미널에서 잘 실행 나를 :
requests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
어떻게이 문제를 해결할 수 있습니까?