Gregniuki commited on
Commit
78fdc67
·
verified ·
1 Parent(s): b156f40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -464,7 +464,7 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence, cross_fa
464
  audio, sr = torchaudio.load(ref_audio)
465
 
466
  # Use the new chunk_text function to split gen_text
467
- max_chars = int(speed * 0.5 * (len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (20 - audio.shape[-1] / sr )))
468
  print(f"text: {max_chars} ")
469
  gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
470
  print('ref_text', ref_text)
@@ -597,7 +597,14 @@ with gr.Blocks() as app_tts:
597
  "no", # Norwegian
598
  "da", # Danish
599
  "is", # Icelandic
600
- "nl" # Dutch
 
 
 
 
 
 
 
601
  ], label="Choose Language", value="en-us"
602
  )
603
  gr.Markdown("#Select Synthesized Language")
@@ -618,7 +625,14 @@ with gr.Blocks() as app_tts:
618
  "no", # Norwegian
619
  "da", # Danish
620
  "is", # Icelandic
621
- "nl" # Dutch
 
 
 
 
 
 
 
622
  ], label="Choose Language", value="en-us"
623
  )
624
  generate_btn = gr.Button("Synthesize", variant="primary")
 
464
  audio, sr = torchaudio.load(ref_audio)
465
 
466
  # Use the new chunk_text function to split gen_text
467
+ max_chars = int((len(ref_text.encode('utf-8')) / (audio.shape[-1] / sr) * (25 - audio.shape[-1] / sr )))
468
  print(f"text: {max_chars} ")
469
  gen_text_batches = chunk_text(gen_text, max_chars=max_chars)
470
  print('ref_text', ref_text)
 
597
  "no", # Norwegian
598
  "da", # Danish
599
  "is", # Icelandic
600
+ "nl", # Dutch
601
+ "fr",
602
+ "es",
603
+ "pt",
604
+ "it",
605
+ "ro",
606
+ "zh",
607
+ "jp"
608
  ], label="Choose Language", value="en-us"
609
  )
610
  gr.Markdown("#Select Synthesized Language")
 
625
  "no", # Norwegian
626
  "da", # Danish
627
  "is", # Icelandic
628
+ "nl", # Dutch
629
+ "fr",
630
+ "es",
631
+ "pt",
632
+ "it",
633
+ "ro",
634
+ "zh",
635
+ "jp"
636
  ], label="Choose Language", value="en-us"
637
  )
638
  generate_btn = gr.Button("Synthesize", variant="primary")