mrfakename
commited on
Commit
•
3e15339
1
Parent(s):
6b5ba9c
Update melo/api.py
Browse files- melo/api.py +6 -1
melo/api.py
CHANGED
@@ -70,13 +70,18 @@ class TTS(nn.Module):
|
|
70 |
# print(" > ===========================")
|
71 |
return texts
|
72 |
|
73 |
-
def tts_to_file(self, text, speaker_id, output_path=None, sdp_ratio=0.2, noise_scale=0.6, noise_scale_w=0.8, speed=1.0, pbar=None, format=None):
|
74 |
language = self.language
|
75 |
texts = self.split_sentences_into_pieces(text, language)
|
76 |
audio_list = []
|
77 |
tx = texts
|
78 |
if pbar:
|
79 |
tx = pbar(texts)
|
|
|
|
|
|
|
|
|
|
|
80 |
for t in tx:
|
81 |
if language in ['EN', 'ZH_MIX_EN']:
|
82 |
t = re.sub(r'([a-z])([A-Z])', r'\1 \2', t)
|
|
|
70 |
# print(" > ===========================")
|
71 |
return texts
|
72 |
|
73 |
+
def tts_to_file(self, text, speaker_id, output_path=None, sdp_ratio=0.2, noise_scale=0.6, noise_scale_w=0.8, speed=1.0, pbar=None, format=None, position=None):
|
74 |
language = self.language
|
75 |
texts = self.split_sentences_into_pieces(text, language)
|
76 |
audio_list = []
|
77 |
tx = texts
|
78 |
if pbar:
|
79 |
tx = pbar(texts)
|
80 |
+
else:
|
81 |
+
if position:
|
82 |
+
tx = tqdm(texts, position=position)
|
83 |
+
else:
|
84 |
+
tx = tqdm(texts)
|
85 |
for t in tx:
|
86 |
if language in ['EN', 'ZH_MIX_EN']:
|
87 |
t = re.sub(r'([a-z])([A-Z])', r'\1 \2', t)
|