2024-10-04 11:28:58 发布
网友
我正在制作一个python程序,它应该发送一个小的.wav音频剪辑并得到响应,我已经尝试了几件事,但我无法提出一个成功的请求,直到现在
更多详情: https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/apis/#!/speech-to-text/recognizeSessionless
那些已经尝试过这个平台的人
请尝试以下代码:
import requests url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize' username = '<username>' password = '<password>' headers={'Content-Type': 'audio/wav'} audio = open('./sheet.wav', 'rb') r = requests.post(url, data=audio, headers=headers, auth=(username, password)) print(r.text)
请尝试以下代码:
相关问题 更多 >
编程相关推荐