TextToVoiceUsingOpenVoice / english_patch.py
SohomToom's picture
Create english_patch.py
a23854b verified
raw
history blame contribute delete
367 Bytes
# english_patch.py
import melo.text.english as eng
orig_g2p = eng.g2p
def patched_g2p(text):
phones, tones, word2ph = orig_g2p(text)
fixed_word2ph = []
for aaa in word2ph:
if isinstance(aaa, int):
fixed_word2ph.append(aaa)
else:
fixed_word2ph += aaa
return phones, tones, fixed_word2ph
eng.g2p = patched_g2p