shiveshnavin commited on
Commit
2c04641
·
1 Parent(s): c00bcb0

Initial Commit

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. app.py +27 -0
  3. reqirements.txt +3 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ flagged/
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from TTS.api import TTS
3
+
4
+ model_name = 'tts_models/en/vctk/vits'
5
+ promisingM = ['p282', 'p301', 'p234', 'p232', 'p256', 'p267', 'p272']
6
+ promisingF = ['p311', 'p361', 'p263', 'p306', 'p259']
7
+ speakers = promisingM + promisingF
8
+ tts = TTS(model_name)
9
+
10
+ def text_to_speech(sentence, speaker_name):
11
+ wav = tts.tts(text=sentence, speaker=speaker_name, file_path=None, verbose=False)
12
+ return wav
13
+
14
+ iface = gr.Interface(
15
+ fn=text_to_speech,
16
+ inputs=["text", "text"],
17
+ outputs="audio",
18
+ inputs_label=["Enter Sentence", "Enter Speaker Name"],
19
+ outputs_label="Audio",
20
+ examples=[
21
+ ["Hello, this is a sample sentence.", "p282"],
22
+ ["How are you doing?", "p301"],
23
+ ]
24
+ )
25
+
26
+ if __name__ == "__main__":
27
+ iface.launch()
reqirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ gradio
2
+ TTS
3
+ numpy==1.24.1