Update app.py
Browse files
app.py
CHANGED
@@ -159,8 +159,8 @@ def process_video(video_file, language_choice):
|
|
159 |
segment_path = os.path.join(output_dir, f'segment_{start}_{end}.wav')
|
160 |
model.tts_to_file(translated_text, speaker_id, segment_path, speed=speed)
|
161 |
|
162 |
-
reference_speaker = AudioFileClip.subclip(audio_clip,
|
163 |
-
|
164 |
target_se, audio_name = se_extractor.get_se("reference_speaker.wav", tone_color_converter, vad=False)
|
165 |
# Run the tone color converter
|
166 |
encode_message = "@MyShell"
|
|
|
159 |
segment_path = os.path.join(output_dir, f'segment_{start}_{end}.wav')
|
160 |
model.tts_to_file(translated_text, speaker_id, segment_path, speed=speed)
|
161 |
|
162 |
+
reference_speaker = AudioFileClip.subclip(audio_clip, 5, 10) # This is the voice you want to clone
|
163 |
+
reference_speaker.write_audiofile("reference_speaker.wav")
|
164 |
target_se, audio_name = se_extractor.get_se("reference_speaker.wav", tone_color_converter, vad=False)
|
165 |
# Run the tone color converter
|
166 |
encode_message = "@MyShell"
|