Revision e21d7f2c tts_bridge/mary/mary_tts_bridge/MaryTTSClient.py
| tts_bridge/mary/mary_tts_bridge/MaryTTSClient.py | ||
|---|---|---|
| 59 | 59 |
self.tts_port = tts_port |
| 60 | 60 |
self.locale = locale |
| 61 | 61 |
self.voice = voice |
| 62 |
|
|
| 62 |
|
|
| 63 | 63 |
def __del__(self): |
| 64 | 64 |
"""destructor |
| 65 | 65 |
""" |
| ... | ... | |
| 105 | 105 |
params = urllib.urlencode(raw_params) |
| 106 | 106 |
headers = {}
|
| 107 | 107 |
|
| 108 |
#open connection to mary server |
|
| 109 |
conn = httplib.HTTPConnection(self.tts_host, self.tts_port) |
|
| 110 |
|
|
| 111 | 108 |
#conn.set_debuglevel(5) |
| 109 |
#open connection to mary server |
|
| 110 |
conn = httplib.HTTPConnection(self.tts_host, self.tts_port) |
|
| 112 | 111 |
|
| 113 | 112 |
conn.request("POST", "/process", params, headers)
|
| 114 | 113 |
response = conn.getresponse() |
| 114 |
|
|
| 115 | 115 |
if response.status != 200: |
| 116 | 116 |
print response.getheaders() |
| 117 |
conn.close() |
|
| 117 | 118 |
raise RuntimeError("{0}: {1}".format(response.status,response.reason))
|
| 118 | 119 |
return response.read() |
| 119 | 120 |
|
Also available in: Unified diff