ibm_watson.websocket.synthesize_listener module¶
-
class
SynthesizeListener
(options, callback, url, headers, http_proxy_host=None, http_proxy_port=None, verify=None)[source]¶ Bases:
object
-
on_open
(ws)[source]¶ Callback executed when a connection is opened to the server. Handles sending text to server
- Parameters
ws – Websocket client
-
on_data
(ws, message, message_type, fin)[source]¶ Callback executed when message is received from the server.
- Parameters
ws – Websocket client
message – utf-8 string which we get from the server.
message_type – Message type which is either ABNF.OPCODE_TEXT or ABNF.OPCODE_BINARY
fin – continue flag. If 0, the data continues.
-