Dionyssos commited on
Commit
dafcadc
·
1 Parent(s): 2bf7855

fx foreign accents

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. build_en_foreign_accents.py +302 -0
  3. demo.py +17 -17
README.md CHANGED
@@ -26,7 +26,7 @@ Expansion of [SHIFT TTS tool](https://github.com/audeering/shift) with [AudioGen
26
 
27
  ## Available Voices
28
 
29
- <a href="https://audeering.github.io/shift/">Listen to available voices!</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/discussions/3#6781475153cd2d16be51b743">Non-native accents!</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/blob/main/Utils/all_langs.csv">Foreign languages</a>
30
 
31
  [TTS Demo](https://huggingface.co/dkounadis/artificial-styletts2/blob/main/demo.py) save `demo.wav`
32
 
 
26
 
27
  ## Available Voices
28
 
29
+ <a href="https://audeering.github.io/shift/">Native English voices!</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/discussions/1#6783e3b00e7d90facec060c6">Non-native English accents!</a> / <a href="https://huggingface.co/dkounadis/artificial-styletts2/blob/main/Utils/all_langs.csv">Foreign languages</a>
30
 
31
  [TTS Demo](https://huggingface.co/dkounadis/artificial-styletts2/blob/main/demo.py) save `demo.wav`
32
 
build_en_foreign_accents.py ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import numpy as np
3
+ import soundfile
4
+ import msinference
5
+
6
+ foreign_accents_en = os.listdir('assets/wavs/mimic3_foreign/') # build by mimic3 USE assets/wavs/style_vector/ for native
7
+ foreign_accents_en = sorted(foreign_accents_en)
8
+
9
+
10
+
11
+
12
+ def tts_entry(text='A quick brown fox jumps over the lazy dog. Sweet dreams are made of this, I traveled the world and the seven seas.',
13
+ voice='af_ZA/google-nwu_1919', # 'serbian', # 'en_US/vctk_low#p276', 'isl', 'abi',
14
+ speed=1.4, # only for non-english
15
+ affect = True # False = high clarity for partially sight
16
+ ):
17
+ '''returns 24kHZ np.array TTS
18
+
19
+ voice : 'en_US/vctk_low#p276' # from English voices -> https://audeering.github.io/shift/
20
+
21
+ or
22
+
23
+ voice : FOREIGN ACCENTS
24
+
25
+ or
26
+
27
+ voice : 'deu' # from LHS code -> https://huggingface.co/dkounadis/artificial-styletts2/blob/main/Utils/all_langs.csv
28
+ '''
29
+
30
+ # StyleTTS2 - English
31
+
32
+ # mimic-3 format of voice (English txt - English accent)
33
+
34
+ if ('en_US/' in voice) or ('en_UK/' in voice):
35
+ a = '' if affect else 'v2/'
36
+ style_vector = msinference.compute_style('assets/wavs/style_vector/' + a + voice.replace(
37
+ '/', '_').replace('#', '_').replace(
38
+ 'cmu-arctic', 'cmu_arctic').replace(
39
+ '_low', '') + '.wav')
40
+
41
+ x = msinference.inference(text,
42
+ style_vector,
43
+ alpha=0.3,
44
+ beta=0.7,
45
+ diffusion_steps=7,
46
+ embedding_scale=1)
47
+
48
+ # mimic-3 format of voice (English text - Foreign accent)
49
+
50
+ elif '_' in voice: # MSS-TTS dont have '_' HOWEVER all assets/wavs/mimic3_foreign_4x have '_'
51
+ style_vector = msinference.compute_style('assets/wavs/mimic3_foreign_4x/' + voice.replace(
52
+ '/', '_').replace('#', '_').replace(
53
+ 'cmu-arctic', 'cmu_arctic').replace(
54
+ '_low', '') + '.wav')
55
+
56
+ x = msinference.inference(text,
57
+ style_vector,
58
+ alpha=0.3,
59
+ beta=0.7,
60
+ diffusion_steps=7,
61
+ embedding_scale=1)
62
+
63
+
64
+ # Fallback - MMS TTS - Non-English
65
+
66
+ else:
67
+
68
+ # dont split foreign sentences: Avoids re-load of VITS & random speaker change issue
69
+ x = msinference.foreign(text=text,
70
+ lang=voice, # voice = 'romanian', 'serbian' 'hungarian'
71
+ speed=speed) # normalisation externally
72
+
73
+ # volume
74
+
75
+ x /= np.abs(x).max() + 1e-7 # amplify speech to full [-1,1]
76
+ print(x.shape, 'TTS OK')
77
+ return x
78
+
79
+ ONLY_PARSE_TABLE = False # also generate .wavs if not already uploaded to issue and links are taken
80
+ if not ONLY_PARSE_TABLE:
81
+ from pathlib import Path
82
+ Path('foreign_accents_en_dir/').mkdir(parents=True, exist_ok=True)
83
+
84
+ for v in foreign_accents_en:
85
+ _str = v[:-4] # strip .wav
86
+ print(_str)
87
+ try:
88
+ soundfile.write('foreign_accents_en_dir/' + v, tts_entry(voice=_str), 24000)
89
+ # checkt out folder to count all phonemized voices
90
+ except RuntimeError:
91
+ # return F.conv2d(input, weight, bias, self.stride, # ENGLISH letters not phonemisable for this ACCENT/LANG
92
+ # RuntimeError: Calculated padded input size per channel: (5 x 4). Kernel size: (5 x 5). Kernel size can't be greater than actual input size
93
+ print('SKIP', _str)
94
+
95
+
96
+
97
+ # --------------------------------------------------- Uploads in hf issue
98
+ upload_wav = ['<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/tcnoTH-oHKC582O_LFlWF.wav"></audio>',
99
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/lsMnciJ8SjdVHHm7r3fWj.wav"></audio>',
100
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/PCvruWc3TeGrQT49Ysx7m.wav"></audio>',
101
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/0phadlvni_1Wqpaontq0R.wav"></audio>',
102
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/OpDULPOgboiwGdSdJNp9N.wav"></audio>',
103
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rFte6QmNZZ68RVD5rK10n.wav"></audio>',
104
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Zrvwb3uGTXXQzbiJjMAKD.wav"></audio>',
105
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Sg8TwofY5T_NcleMzkSrR.wav"></audio>',
106
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/5si01GF0nkn-Gz0x6nesw.wav"></audio>',
107
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/1Lf-I29-7PDhKlIvDstnY.wav"></audio>',
108
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/fNwY7aK5CfZH6GcEWiacP.wav"></audio>',
109
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/OPmjl9NPbxy41O7nYGEVB.wav"></audio>',
110
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/9hf7B1hRGb_FVyeg9uAOD.wav"></audio>',
111
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/zqDGx-01TwRfWM3bN60rM.wav"></audio>',
112
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/VHy2T7WGmO3G6KNetaAdh.wav"></audio>',
113
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/3__dS3cWkNHhyUnbwucdM.wav"></audio>',
114
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/uyj76HsI5JuRrQ4kQR08J.wav"></audio>',
115
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/EAvtFGcGywlYD-UXr-CCp.wav"></audio>',
116
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/e3eQuOZaflCBa5s8wz2Ed.wav"></audio>',
117
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/lxFK9F5fB0NkdKQcCdssi.wav"></audio>',
118
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/c-_VsUOHnMSLQIKi0_4PQ.wav"></audio>',
119
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/9IbYJ8zrrvI_xyS3iCmLR.wav"></audio>',
120
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/g2IqCY0_od5p3I5A90DEn.wav"></audio>',
121
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/zL5_-rxwphgmLNyPM23f4.wav"></audio>',
122
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/2vQPOru4NdTbH616Q_1yN.wav"></audio>',
123
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/uwpaoAoMPDvppyyeFo5tJ.wav"></audio>',
124
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/HdgqQIO3VpSufpjLIZQF2.wav"></audio>',
125
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/MzseVJh_bywZ3aCSOQXQM.wav"></audio>',
126
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Www8hep27Hj7MmkBIgLZL.wav"></audio>',
127
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/xfZc4UfdncqYSBPGH0UU6.wav"></audio>',
128
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/uGdqyy3_AGYVVKZPNipJq.wav"></audio>',
129
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/cY7mdGf5B9sSzdua2JO3C.wav"></audio>',
130
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/NN67iueryypo1c5LjZipL.wav"></audio>',
131
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/kLGMvy4nnpvvBxtsDVbRq.wav"></audio>',
132
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/5sCT2T7OwBm9J_jEqVtNn.wav"></audio>',
133
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/KobQIA3hZBP8gYtxi8Vuz.wav"></audio>',
134
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/xdiFcfnDu1Z5YbU3vSNkL.wav"></audio>',
135
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/BbFpWYrG2t5k23eAjo5Ph.wav"></audio>',
136
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/CxwF3YsFyWk2ECHuBR3Qu.wav"></audio>',
137
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/eyYkMNrEKOpEcZ5DlH_VX.wav"></audio>',
138
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/EPq1BcT8GOFAW4bVjwfBF.wav"></audio>',
139
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/cfGsdQLuBvFP6pfVKZIFJ.wav"></audio>',
140
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/UcrbcO-8BchNKj73cNbGv.wav"></audio>',
141
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/DROWenR8hSTfIaxeRbXrp.wav"></audio>',
142
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/xl0IMxgU-VpRzvt9JzUYB.wav"></audio>',
143
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/t7bfO1C9s0NhGcbbGq8sh.wav"></audio>',
144
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/GIAcqWc9xRcNaEcVtFXeK.wav"></audio>',
145
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/3tjoaUUjBcniZKRhrvLpV.wav"></audio>',
146
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rO0WVyT5aaeWzYoKNgpst.wav"></audio>',
147
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/bE0t-nkoQDFfLn-sRhbKI.wav"></audio>',
148
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/APTqZMj3hzVS8MkNrPy2e.wav"></audio>',
149
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/fIdWAEsdas7EFBAZi5HGr.wav"></audio>',
150
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/NwPxPqjzMXl3e21ca7mUw.wav"></audio>',
151
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/dzwehfssREMDMxny0yL63.wav"></audio>',
152
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/hEBBvmQwYg-KJcCZalZiZ.wav"></audio>',
153
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/prG_fiqWCZ2YzpwH19bc5.wav"></audio>',
154
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/A3tKcd6vPqNirgU6Tmq_F.wav"></audio>',
155
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/iFEZDc17LPYhBP_Vbnfg6.wav"></audio>',
156
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZERyM-DeqGitbA4UUAFXk.wav"></audio>',
157
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/nHh22UITkR0TLaFmRxwaC.wav"></audio>',
158
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/kI6yW7eERvRGljXUV4mE8.wav"></audio>',
159
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/_3wFCkVDVRatE4iTDD9of.wav"></audio>',
160
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/QTEgmQKIdWk_0Wa_aj7Mp.wav"></audio>',
161
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/LPS2hPWHOokZCabQH5r2b.wav"></audio>',
162
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/vid7-loC2ie25PrB-yTP7.wav"></audio>',
163
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/FwH1HP_KzR6hp2b0vz3BS.wav"></audio>',
164
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Dc_VpSHhbbN3oP5B6CP_U.wav"></audio>',
165
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7-QihwiR47VV6JYPIjcSO.wav"></audio>',
166
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZDYbOTfks1dc91vSVSAkF.wav"></audio>',
167
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/cmpFoBoXXg6tusJwQ0TVp.wav"></audio>',
168
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/UwtcgY6LKIuR8tXK4_XZq.wav"></audio>',
169
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/-TVU-hzNdz8ksUCOkLwEK.wav"></audio>',
170
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/OIgWx7tykduGE7rCmrJj2.wav"></audio>',
171
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/_llxVo2vB2OZdxa3TC03b.wav"></audio>',
172
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/-H87_SZ_-z5YSMWywWuBu.wav"></audio>',
173
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/2u6KU3whYmtJsksGJ4TAF.wav"></audio>',
174
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/xbfMIIHB1R0Nc9DKTC7iD.wav"></audio>',
175
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/U3FOLnurlJZFAoDftrUCc.wav"></audio>',
176
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/z1Y5rPOpCU8zyfh9xMHC8.wav"></audio>',
177
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/GEeM0zENGm-kVjsRlzBR9.wav"></audio>',
178
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/nXJF2wcO8JQrJEwxt0CWa.wav"></audio>',
179
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/3aLx2HWPjZhXnGcnqVyN_.wav"></audio>',
180
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/CQUTIcmxMN_cAMDWcI4dT.wav"></audio>',
181
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZXdR6h0u7rngo_0Y7aNq-.wav"></audio>',
182
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/I17mwpu1hBEQ5tiztVFvf.wav"></audio>',
183
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/_79IA0EeYGWv_XCqKYWjL.wav"></audio>',
184
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7bXEZoOgV4GK44DDcSb3V.wav"></audio>',
185
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/v8qx5esXkEs9AgJ16QDLn.wav"></audio>',
186
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/oXc0RvlO6irEpFyywjd0Y.wav"></audio>',
187
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/FP3qGPszZ7JHISkSKLKLC.wav"></audio>',
188
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/pUlBI3AKAA0YvYAsq862F.wav"></audio>',
189
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Wk7LbEV091JS8EOYRHv-H.wav"></audio>',
190
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/tC50fzKPesQPC6P2MHK5Z.wav"></audio>',
191
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/tb8bx1t_R1m9dk8JGSM-R.wav"></audio>',
192
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7DWFWMuvlNucCRJzbrti8.wav"></audio>',
193
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/RoR4usdzsAdqETmqDWXF9.wav"></audio>',
194
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/FUdZxxwHkgenVnlnZIiE0.wav"></audio>',
195
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/JLpZjbD_Q9xz9ALxv6Lb6.wav"></audio>',
196
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/UR0XeOX5TBRz-E0Q3MiUi.wav"></audio>',
197
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ekpZN-Y2AwLBktONHe2rT.wav"></audio>',
198
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/w169fabF0Ikzg8bSYhYZ_.wav"></audio>',
199
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/VBj6EMKVZZu0EdY4BFVPj.wav"></audio>',
200
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/w5M-YW98SxkGqVigIeazk.wav"></audio>',
201
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7HAAMt3P0DFSjWF9rEoS5.wav"></audio>',
202
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Ps4zKStfyPjnDY_7Lvf_a.wav"></audio>',
203
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/enEYioY0s8ehnksNAM-8x.wav"></audio>',
204
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/55ag7Mx8mfPxdUxsydCWz.wav"></audio>',
205
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/eMWD601Fs6gnoXyy_KAtb.wav"></audio>',
206
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/9tcZh0QrB0PjIT48upiV4.wav"></audio>',
207
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/BSMAPR4S7hVy0aEu78AW4.wav"></audio>',
208
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ClBhkMfbG191veRPkv5BR.wav"></audio>',
209
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/oSJzim5WJ0mftSL3VDVL_.wav"></audio>',
210
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/69ZVRIrFy_3OyTwu0ePCL.wav"></audio>',
211
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rWyoVG80q79WmIt6qC-i2.wav"></audio>',
212
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/AFOyqiq6nV31Ht8RVk4pE.wav"></audio>',
213
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/6zqXo8YIc1LYtqcRQiU87.wav"></audio>',
214
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/BzxYY74haOUXUiPD4CSMQ.wav"></audio>',
215
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/gLs9Uh0VHyJkxQLwUIm5u.wav"></audio>',
216
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ydIav1KW_bS--UTF5ASjw.wav"></audio>',
217
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/zr8jIGcshhTHcIfFDGSkz.wav"></audio>',
218
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rDrlJu_cNWNeFwApd7f6w.wav"></audio>',
219
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/DXhsSBGqaKYrfv-neJJR_.wav"></audio>',
220
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/aai0BMCZ-HhS30yFPsK7U.wav"></audio>',
221
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/EE9af9Dx3DbKboJLOYu1A.wav"></audio>',
222
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/9hV8nPjkSuRQhA3ICHfkI.wav"></audio>',
223
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/3sz54kXM2GoDXh7uYsOoi.wav"></audio>',
224
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/0g4eiOYsnck-J1VQN_DPR.wav"></audio>',
225
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/OHig_oh991EFVAZnmN2se.wav"></audio>',
226
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rWK2doX7sciqApAbjDMDS.wav"></audio>',
227
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Pq_sxS3u0hU_VjQAG2eEl.wav"></audio>',
228
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/EMI3mlfqLv7VDPj7R3OEe.wav"></audio>',
229
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/04TmQiiCkA0P6FBk6GNq3.wav"></audio>',
230
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/1JFmmyN4Vf9a-9JvWRn8f.wav"></audio>',
231
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/f2IrNp0DpTHZOp4ziJuto.wav"></audio>',
232
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7nHah4_k-Nnsdz9pCLART.wav"></audio>',
233
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/jWJM25aiqLg1jS0Rha56d.wav"></audio>',
234
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Wsj8AmTGY5HGp9FTq3gNN.wav"></audio>',
235
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/cn8zqEnzt5MTXis4GOMV2.wav"></audio>',
236
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/WJtVJSP9AvvmSy995lHP9.wav"></audio>',
237
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/K8xvU8siKXS9-DD3ttYZu.wav"></audio>',
238
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Ii5kT-WO-mO1T7FKX-ZJb.wav"></audio>',
239
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ooiIZRX8FBgAqgQDUblce.wav"></audio>',
240
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Xhr7P_smfCPqGH-2HXg7N.wav"></audio>',
241
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/sypc4dSJsY5Dx5R0d09lG.wav"></audio>',
242
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/LgMcdXwhXGVvjF_gOoksi.wav"></audio>',
243
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/pswVSeNb9b-KCsXFAG7K3.wav"></audio>',
244
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/SISB0SS5DrRoLRReAs_9J.wav"></audio>',
245
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/G0M_vcHDn95ymI7JvRfnm.wav"></audio>',
246
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/5FtkG5Oa7dB1K4PKpZexo.wav"></audio>',
247
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/LkozDdCOAlPrhI-iizlL3.wav"></audio>',
248
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/V0zhJ1NBe5IOLnsWUM7F-.wav"></audio>',
249
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/0-iGSA0V4ccAd1L4dRy4u.wav"></audio>',
250
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/UBeF3qL3rrEUx1cI5U2Aj.wav"></audio>',
251
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/02OC39IfinLCkQfPbEGCK.wav"></audio>',
252
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/lIH0vlVplKOU3k8XdR2tc.wav"></audio>',
253
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/r6tmrXY0C3ovqbnFZq_kz.wav"></audio>',
254
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/4eazdEx8Qd8C-gDAYM5Ag.wav"></audio>',
255
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/0oeQzDyE6XKmF-eHGOkxz.wav"></audio>',
256
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZC6s_SYFQFTltOGWbfaDV.wav"></audio>',
257
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/Scrk2urbg__EdmmfyfiKx.wav"></audio>',
258
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/tuFuxqina3efoorJwJ58a.wav"></audio>',
259
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/yTzaI09nCeAWn7YIrJfvU.wav"></audio>',
260
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/_ynUkagAFqUv14fTXB-KK.wav"></audio>',
261
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/SbTARXCj-ZH-2Cj1kzeD_.wav"></audio>',
262
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/VqYyJbRmpn23nK1gbIB-M.wav"></audio>',
263
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/gn9RGN5oQvpphYzx4EhYN.wav"></audio>',
264
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/20vvUcCws6rc6b24-evf9.wav"></audio>',
265
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/2inq2YStIoMR3CRrmaoOi.wav"></audio>',
266
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZH64TD5UzNEEK7xjQLLTI.wav"></audio>',
267
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/1H8NOE2Tw5gAnh-q_H8nG.wav"></audio>',
268
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ia2sshLbuJu3a32EAiEOM.wav"></audio>',
269
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/ZPNlhj8vtD2RyUFqApt2M.wav"></audio>',
270
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/DPrePiOKrMz7FwJYqDyJj.wav"></audio>',
271
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/0jQXsWuJHtSKK1yPI1Mps.wav"></audio>',
272
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/BaX7HIMfDQA7lyr_LAc6D.wav"></audio>',
273
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/d0l5VeuG4XaL2mleVqCrV.wav"></audio>',
274
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/BtohNvfJQn9N6o7XNsDVF.wav"></audio>',
275
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/4xSqqN71t9ILvBaKzHx2h.wav"></audio>',
276
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/wTAo-xeUJHbJv7HAad1TM.wav"></audio>',
277
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/oGqYRCnRfjLUsTtp0jhz9.wav"></audio>',
278
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/iBbnrgCxhtLWZWazCg0Rw.wav"></audio>',
279
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/AKvHCiex8Khs8T0lv399w.wav"></audio>',
280
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/-vdE3w_5cWZzx-d754QFz.wav"></audio>',
281
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/67qn-oD7FgY7SKdg7QCzx.wav"></audio>',
282
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/8JVjMUWLJ2SBd_ozLkV_O.wav"></audio>',
283
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/T3W-dvmMFd081QVBKTSan.wav"></audio>',
284
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/rff6hS2OBzL_LPnCItVLa.wav"></audio>',
285
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/c_2QIF2FtHAkQwZKjEIGd.wav"></audio>',
286
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/OS9GMVIXzqWkg3zPpqjLx.wav"></audio>',
287
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/VZx-MrOefIBUjVci8fsQV.wav"></audio>',
288
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/hGH8ERqfJY5P4WOAHkT0j.wav"></audio>',
289
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/B5_I-RHhlPfENt1U2qNac.wav"></audio>',
290
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/7z5yf1shPZ6K1lA4kq9tC.wav"></audio>',
291
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/gYvnDFevsXDo7uDJFhf8Z.wav"></audio>',
292
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/zdQL6FxSaGR0eesXMgJZY.wav"></audio>',
293
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/6Tzg1D1emdIGdx1dBVKk6.wav"></audio>',
294
+ '<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/65ae91633db2280ece0a6b02/cfw1YoFofxlI42871v9GL.wav"></audio>',]
295
+
296
+ tmp = '<table><tr><th> </th><th> voice </th><th> TTS </th></tr>'
297
+ for j, (voice, _f) in enumerate(zip(sorted(os.listdir('foreign_accents_en_dir/')), upload_wav)):
298
+ tmp += f'<tr>\n<td>\n\n{j}\n\n</td>\n<td>\n\n {voice[:-4]} \n\n</td>\n<td>\n\n {_f} \n\n</td>\n</tr>\n'
299
+
300
+ tmp += '\n\n</table>'
301
+ with open('table_for_issue_accents_upload.txt', 'w') as f:
302
+ f.write(tmp)
demo.py CHANGED
@@ -4,56 +4,56 @@ import msinference
4
 
5
 
6
  def tts_entry(text='A quick brown fox jumps over the lazy dog. Sweet dreams are made of this, I traveled the world and the seven seas.',
7
- voice='af_ZA/google-nwu_1919', # 'serbian', # 'en_US/vctk_low#p276', 'isl', 'abi',
8
  speed=1.4, # only for non-english
9
  affect = True # False = high clarity for partially sight
10
  ):
11
  '''returns 24kHZ np.array TTS
12
-
13
  voice : 'en_US/vctk_low#p276' # from English voices -> https://audeering.github.io/shift/
14
-
15
  or
16
-
17
  voice : FOREIGN ACCENTS
18
-
19
- or
20
-
21
  voice : 'deu' # from LHS code -> https://huggingface.co/dkounadis/artificial-styletts2/blob/main/Utils/all_langs.csv
22
  '''
23
 
24
- # StyleTTS2 - English
25
-
26
  # mimic-3 format of voice (English txt - English accent)
27
 
28
- if ('en_US/' in voice) or ('en_UK/' in voice):
29
  a = '' if affect else 'v2/'
30
  style_vector = msinference.compute_style('assets/wavs/style_vector/' + a + voice.replace(
31
  '/', '_').replace('#', '_').replace(
32
  'cmu-arctic', 'cmu_arctic').replace(
33
  '_low', '') + '.wav')
34
-
35
  x = msinference.inference(text,
36
  style_vector,
37
  alpha=0.3,
38
  beta=0.7,
39
  diffusion_steps=7,
40
  embedding_scale=1)
41
-
42
- # mimic-3 format of voice (English text - Foreign accent)
43
-
44
- elif '_' in voice and '/' in voice:
45
  style_vector = msinference.compute_style('assets/wavs/mimic3_foreign_4x/' + voice.replace(
46
  '/', '_').replace('#', '_').replace(
47
  'cmu-arctic', 'cmu_arctic').replace(
48
  '_low', '') + '.wav')
49
-
50
  x = msinference.inference(text,
51
  style_vector,
52
  alpha=0.3,
53
  beta=0.7,
54
  diffusion_steps=7,
55
  embedding_scale=1)
56
-
57
 
58
  # Fallback - MMS TTS - Non-English
59
 
 
4
 
5
 
6
  def tts_entry(text='A quick brown fox jumps over the lazy dog. Sweet dreams are made of this, I traveled the world and the seven seas.',
7
+ voice='af_ZA/google-nwu_1919', # 'serbian', # 'en_US/vctk_low#p276', 'isl', 'abi',
8
  speed=1.4, # only for non-english
9
  affect = True # False = high clarity for partially sight
10
  ):
11
  '''returns 24kHZ np.array TTS
12
+
13
  voice : 'en_US/vctk_low#p276' # from English voices -> https://audeering.github.io/shift/
14
+
15
  or
16
+
17
  voice : FOREIGN ACCENTS
18
+
19
+ or
20
+
21
  voice : 'deu' # from LHS code -> https://huggingface.co/dkounadis/artificial-styletts2/blob/main/Utils/all_langs.csv
22
  '''
23
 
24
+ # StyleTTS2 - En
25
+
26
  # mimic-3 format of voice (English txt - English accent)
27
 
28
+ if ('en_US/' in voice) or ('en_UK/' in voice):
29
  a = '' if affect else 'v2/'
30
  style_vector = msinference.compute_style('assets/wavs/style_vector/' + a + voice.replace(
31
  '/', '_').replace('#', '_').replace(
32
  'cmu-arctic', 'cmu_arctic').replace(
33
  '_low', '') + '.wav')
34
+
35
  x = msinference.inference(text,
36
  style_vector,
37
  alpha=0.3,
38
  beta=0.7,
39
  diffusion_steps=7,
40
  embedding_scale=1)
41
+
42
+ # mimic-3 format of voice (English text - Foreign accent)
43
+
44
+ elif '_' in voice:
45
  style_vector = msinference.compute_style('assets/wavs/mimic3_foreign_4x/' + voice.replace(
46
  '/', '_').replace('#', '_').replace(
47
  'cmu-arctic', 'cmu_arctic').replace(
48
  '_low', '') + '.wav')
49
+
50
  x = msinference.inference(text,
51
  style_vector,
52
  alpha=0.3,
53
  beta=0.7,
54
  diffusion_steps=7,
55
  embedding_scale=1)
56
+
57
 
58
  # Fallback - MMS TTS - Non-English
59