我正在使用SpeechRecognition库。
import speech_recognition as sr
AUDIO_FILE = 'test_audio.wav'
with open("api-key.json") as f:
GOOGLE_CLOUD_SPEECH_CREDENTIALS = f.read()
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio = r.record(source)
print('Starting
如本IoT所述,我试图使用脚本来设置AWS 。
我能够在AWS IoT MQTT上连接,而不需要WebSocket (使用x.509证书)。
# creates the AWS IoT
def createIoT():
iot = AWSIoTMQTTShadowClient('AWSHome')
# update this with your own endpoint from the IOT dashboard
iot.configureEndpoint('allj.iot.reg.amazonaws.com', 443)
我在我的计算机(Ubuntu10.04和Python3.2)上测试来自的代码。
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
... data=b'This data is passed to stdin of the CGI')
>>> f = urllib.request.urlopen(req)
>>> print(f.read()