Revision 38936fe1 tts_bridge/mary/mary_tts_bridge/MaryTTSBridge.py
tts_bridge/mary/mary_tts_bridge/MaryTTSBridge.py | ||
---|---|---|
36 | 36 |
import wave |
37 | 37 |
import os |
38 | 38 |
import pkgutil |
39 |
from MaryTTSClient import * |
|
40 |
from cStringIO import StringIO |
|
39 |
from .MaryTTSClient import * |
|
40 |
try: |
|
41 |
from io import StringIO |
|
42 |
except ImportError: |
|
43 |
from cStringIO import StringIO |
|
41 | 44 |
|
42 | 45 |
class MaryTTSBridge(object): |
43 | 46 |
#_feedback = ttsActionFeedback() |
... | ... | |
110 | 113 |
|
111 | 114 |
return s |
112 | 115 |
|
113 |
def create_phonemes(self, phoneme_str):
|
|
116 |
def create_phonemes(self, phoneme_bytes):
|
|
114 | 117 |
last = 0.0 |
115 | 118 |
plist = [] |
116 | 119 |
|
117 |
sio = StringIO(phoneme_str)
|
|
120 |
sio = StringIO(phoneme_bytes.decode('ascii'))
|
|
118 | 121 |
for line in sio: |
119 | 122 |
if (line[0] != '#'): |
120 | 123 |
phoneme_list = line.split(" ") |
Also available in: Unified diff