tobiccino commited on
Commit
a9a877b
1 Parent(s): 2921b0f

test app.py

Browse files
Files changed (2) hide show
  1. app.py +2 -0
  2. vietTTS/synthesizer.py +9 -7
app.py CHANGED
@@ -1,6 +1,8 @@
1
  import gradio as gr
 
2
 
3
  def greet(name):
 
4
  return "Hello " + name + "!!"
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
1
  import gradio as gr
2
+ import vietTTS.synthesizer.run
3
 
4
  def greet(name):
5
+ run()
6
  return "Hello " + name + "!!"
7
 
8
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
vietTTS/synthesizer.py CHANGED
@@ -30,10 +30,12 @@ def nat_normalize_text(text):
30
  text = re.sub(f"( {sil}+)+ ", f" {sil} ", text)
31
  return text.strip()
32
 
33
-
34
- text = nat_normalize_text(args.text)
35
- print("Normalized text input:", text)
36
- mel = text2mel(text, args.lexicon_file, args.silence_duration)
37
- wave = mel2wave(mel)
38
- print("writing output to file", args.output)
39
- sf.write(str(args.output), wave, samplerate=args.sample_rate)
 
 
 
30
  text = re.sub(f"( {sil}+)+ ", f" {sil} ", text)
31
  return text.strip()
32
 
33
+ def run():
34
+ # text = nat_normalize_text(args.text)
35
+ text = nat_normalize_text("ahihi do ngoc")
36
+ print("Normalized text input:", text)
37
+ # mel = text2mel(text, args.lexicon_file, args.silence_duration)
38
+ # mel = text2mel(text, "./assets/infore/lexicon.txt", 0.15)
39
+ # wave = mel2wave(mel)
40
+ # print("writing output to file", "output.wav")
41
+ # sf.write(str("output.wav"), wave, samplerate=16000)