Hilley commited on
Commit
c120050
1 Parent(s): 3327c84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -5
app.py CHANGED
@@ -88,14 +88,28 @@ def generate_audio(text, audio_ref, temperature, top_P, top_K, audio_seed_input,
88
  save_path = "output.wav"
89
 
90
  # Run the base speaker tts
91
- #src_path = "tmp.wav"
92
- #chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input, src_path)
93
- src_path = None
94
- sample_rate, audio = chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input, src_path)[0]
95
  print("Ready for voice cloning!")
96
-
 
 
 
97
  # Run the tone color converter
98
  encode_message = "@Hilley"
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  tone_color_converter.convert_data(
100
  audio=audio,
101
  sample_rate=sample_rate,
@@ -103,6 +117,7 @@ def generate_audio(text, audio_ref, temperature, top_P, top_K, audio_seed_input,
103
  tgt_se=target_se,
104
  output_path=save_path,
105
  message=encode_message)
 
106
  print("Finished!")
107
 
108
  return "output.wav"
 
88
  save_path = "output.wav"
89
 
90
  # Run the base speaker tts
91
+ src_path = "tmp.wav"
92
+ chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input, src_path)
 
 
93
  print("Ready for voice cloning!")
94
+
95
+ source_se, audio_name = se_extractor.get_se(src_path, tone_color_converter, target_dir='processed', vad=True)
96
+ print("Get source segment!")
97
+
98
  # Run the tone color converter
99
  encode_message = "@Hilley"
100
+ # convert from file
101
+ tone_color_converter.convert_data(
102
+ audio_src_path=src_path,
103
+ src_se=source_se,
104
+ tgt_se=target_se,
105
+ output_path=save_path,
106
+ message=encode_message)
107
+
108
+ '''
109
+ # convert from data
110
+ src_path = None
111
+ sample_rate, audio = chat_tts(text, temperature, top_P, top_K, audio_seed_input, text_seed_input, refine_text_flag, refine_text_input, src_path)[0]
112
+ print("Ready for voice cloning!")
113
  tone_color_converter.convert_data(
114
  audio=audio,
115
  sample_rate=sample_rate,
 
117
  tgt_se=target_se,
118
  output_path=save_path,
119
  message=encode_message)
120
+ '''
121
  print("Finished!")
122
 
123
  return "output.wav"