Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -592,7 +592,8 @@ def convert_chapters_to_audio_custom_model(chapters_dir, output_audio_dir, targe
|
|
592 |
|
593 |
|
594 |
|
595 |
-
def convert_chapters_to_audio_standard_model(chapters_dir, output_audio_dir, target_voice_path=None, language=
|
|
|
596 |
selected_tts_model = "tts_models/multilingual/multi-dataset/xtts_v2"
|
597 |
tts = TTS(selected_tts_model, progress_bar=False).to(device)
|
598 |
|
@@ -625,10 +626,10 @@ def convert_chapters_to_audio_standard_model(chapters_dir, output_audio_dir, tar
|
|
625 |
print(f"Generating fragment: {fragment}...")
|
626 |
fragment_file_path = os.path.join(temp_audio_directory, f"{temp_count}.wav")
|
627 |
speaker_wav_path = target_voice_path if target_voice_path else default_target_voice_path
|
628 |
-
|
629 |
-
print(f"The TTS language code given is: {
|
630 |
print(f"The TTS text chunk is: {fragment} ")
|
631 |
-
tts.tts_to_file(text=fragment, file_path=fragment_file_path, speaker_wav=speaker_wav_path, language=
|
632 |
temp_count += 1
|
633 |
|
634 |
combine_wav_files(temp_audio_directory, output_audio_dir, output_file_name)
|
|
|
592 |
|
593 |
|
594 |
|
595 |
+
def convert_chapters_to_audio_standard_model(chapters_dir, output_audio_dir, target_voice_path=None, language="en"):
|
596 |
+
print(f"The TTS language code given is: {language}")
|
597 |
selected_tts_model = "tts_models/multilingual/multi-dataset/xtts_v2"
|
598 |
tts = TTS(selected_tts_model, progress_bar=False).to(device)
|
599 |
|
|
|
626 |
print(f"Generating fragment: {fragment}...")
|
627 |
fragment_file_path = os.path.join(temp_audio_directory, f"{temp_count}.wav")
|
628 |
speaker_wav_path = target_voice_path if target_voice_path else default_target_voice_path
|
629 |
+
print(f"On generating the audio...")
|
630 |
+
print(f"The TTS language code given is: {language}")
|
631 |
print(f"The TTS text chunk is: {fragment} ")
|
632 |
+
tts.tts_to_file(text=fragment, file_path=fragment_file_path, speaker_wav=speaker_wav_path, language=language)
|
633 |
temp_count += 1
|
634 |
|
635 |
combine_wav_files(temp_audio_directory, output_audio_dir, output_file_name)
|