-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
36 lines (30 loc) · 1.35 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# %%
from tts_arabic import tts
# %%
text = "اَلسَّلامُ عَلَيكُم يَا صَدِيقِي."
# text = "أَلِف با تا ثا جِيم حَا خَا دَال ذَال را زَاي سِين شِين صَاد ضَاد طَا ظَا عَين غَين فَا قَاف كَاف لَام مِيم نُون هَا وَاو يَا."
wave = tts(text, speaker=1, play=True)
# %% Buckwalter transliteration
text = ">als~alAmu Ealaykum yA Sadiyqiy."
wave = tts(text, speaker=0, play=True)
# %% Unvocalized input
text_unvoc = "القهوة مشروب يعد من بذور البن المحمصة"
wave = tts(text_unvoc, play=True, vowelizer='shakkelha')
# %% Inference options
text = "اَلسَّلامُ عَلَيكُم يَا صَدِيقِي."
wave = tts(
text, # input text
speaker = 1, # speaker id; choose between 0,1,2,3
pace = 1, # speaker pace
denoise = 0.005, # vocoder denoiser strength
play = True, # play audio?
pitch_mul = 1, # pitch multiplier
pitch_add = 0, # pitch offset
vowelizer = None, # vowelizer model
model_id = 'fastpitch', # Model ID for Text->Mel model
vocoder_id = 'hifigan', # Model ID for vocoder model
cuda = None, # Optional; CUDA device index
save_to = './test.wav', # Optionally; save audio WAV file
bits_per_sample = 32, # when save_to is specified (8, 16 or 32 bits)
)
# %%