sttClient.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:ibm-tts-stt 作者: santoshghimire 项目源码 文件源码
def onClose(self, wasClean, code, reason):

        # print("onClose")
        # print("WebSocket connection closed: {0}".format(reason), "code: ",
        #       code, "clean: ", wasClean, "reason: ", reason)
        self.summary[self.uttNumber]['status']['code'] = code
        self.summary[self.uttNumber]['status']['reason'] = reason

        # create a new WebSocket connection if there are still
        # utterances in the queue that need to be processed
        self.queue.task_done()

        if self.factory.prepareUtterance() == False:
            return

        # SSL client context: default
        if self.factory.isSecure:
            contextFactory = ssl.ClientContextFactory()
        else:
            contextFactory = None
        connectWS(self.factory, contextFactory)


# function to check that a value is a positive integer
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号